Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

QA - edit procedure shows "create"

0 views
Skip to first unread message

Keith G Hicks

unread,
Nov 20, 2009, 10:09:50 AM11/20/09
to

SQL 2000 Query Analyzer. Well this seems very odd to me. Every stored
procedure I can ever remember doing this with has never done this. When you
have the object browser open and right click a stored procedure, one of the
options is "edit". When you click that option, the procedure opens up and
the definition starts with "ALTER PROCEDURE..."

But last night, I had one start opening with "CREATE PROCEDURE..." instead.
Every time I open it up to edit it, it says "CREATE", not "ALTER".

So I droppted the proc and recreated it just to see what would happen. This
solved the problem. It opens up with the "edit" button showing "ALTER" now
instead of "CREATE". But I'm very curious what was wrong here.Any idea why
this would happen?

Thanks,

Keith


Tibor Karaszi

unread,
Nov 21, 2009, 5:50:35 AM11/21/09
to
Wild guess:

The proc had been renamed so the name of the proc didn't match the stored
source code for the proc and this confused the tool (QA)...

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi

"Keith G Hicks" <k...@comcast.net> wrote in message
news:#b4fFOfa...@TK2MSFTNGP05.phx.gbl...

Erland Sommarskog

unread,
Nov 21, 2009, 6:40:04 AM11/21/09
to
Tibor Karaszi (tibor_please.n...@hotmail.nomail.com) writes:
> Wild guess:
>
> The proc had been renamed so the name of the proc didn't match the stored
> source code for the proc and this confused the tool (QA)...

Sounds plausible. However, I tested that and the problem did not appear.

If I am to make a guess on my own, I would suspect that there is a comment
header, and there is a problem when scripting the procedure because CREATE
appears just around the end of a 4000-character chunk.

Overall, using things like Edit in Query Analyzer is like you would
edit your C# programs by disassembling the object files. Source code
should be kept under version control, and what it's in SQL Server is a
binary repository.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

0 new messages