SQL Server - QA - edit procedure shows "create"

Asked By Keith G Hicks
20-Nov-09 10:09 AM
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 am very curious what was wrong here.Any idea why
this would happen?

Thanks,

Keith
SQL Server
(1)
CREATE PROCEDURE
(1)
Stored procedure
(1)
ALTER PROCEDURE
(1)
Proc
(1)
Please.no.email
(1)
  Tibor Karaszi replied to Keith G Hicks
21-Nov-09 05:50 AM
Wild guess:

The proc had been renamed so the name of the proc did not 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
  Erland Sommarskog replied to Tibor Karaszi
21-Nov-09 07:33 AM
Tibor Karaszi (tibor_please.no.email_karaszi@hotmail.nomail.com) writes:

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 is in SQL Server is a
binary repository.
--
Erland Sommarskog, SQL Server MVP, esquel@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
Create New Account
help
server SQL Server Do I have to set up a sql server database on a sql server? Or can I do this on any server SQL Server Setup Discussions SQL Server (1) CREATE DATABASE (1) Databases (1) Database (1) Create
Attach SQL Server 2008 database to SQL Server 2000 Server SQL Server Hi, I have created a database in SQL Server 2008, with compatibility level of SQL Server 2000. Now when I detach the DB
Linked server SQL Server HI its possible create a local sql server as a linked server In sql server 2000 and Sql server 2005 I thought sql server 2005 its not possible thanks
MSDE on Windows 2003 R2 box, new DL385G6 - Install Fails during SQL Services SQL Server I have been finding that I am having trouble with the Crystal Reports Server XI installation failing when it is dealing with SQL. So, as a thought and in case there was something wrong with my SQL portion of the isntall. I thought ok, I will try installing the actual MSDE application direct from Microsoft. So, I downloaded the MSDE for SQL 2000 (which is msde2000a.exe), set my switches and off to the races. It quit seconds left to the installation and bombed with the same errors as the Crystal Reports Server install. The error is the same whether I try to install MSDE by itself or
Backup on Sql server A and restore to Sql server B SQL Server Hi! I have two SQL Server 2008 Std (Sql Server A and Sql Server B) on Windows Server 2008 R2. SQL