iccsi
2012-04-12 15:56:03 UTC
I use SSMS template to create stored procedure for SQL Server 2000.
SSMS has following code to drop stored procedure exists,
-- Drop stored procedure if it already exists
IF EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'<Schema_Name, sysname, Schema_Name>'
AND SPECIFIC_NAME = N'<Procedure_Name, sysname, Procedure_Name>'
)
Enterprise Manager uses following code to drop stored procedures
exists,
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'MyStroedProc'
AND type = 'P')
DROP PROCEDURE MyStoredProc
I checked that sysobjects is in user database and
INFORMATION_SCHEMA.ROUTINES is in master database system table.
It seems that SSMS uses SQL Server 2008 format to save stored
procedure in master database and SQL Server 2000 not.
It looks like I can not use SSMS stored procedure template to create
SQL Server 2000 stored prrocedure. SSMS template only for SQL Server
2005 and later.
Your help and information is great appreciated,
Regards,
iccsi
SSMS has following code to drop stored procedure exists,
-- Drop stored procedure if it already exists
IF EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'<Schema_Name, sysname, Schema_Name>'
AND SPECIFIC_NAME = N'<Procedure_Name, sysname, Procedure_Name>'
)
Enterprise Manager uses following code to drop stored procedures
exists,
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'MyStroedProc'
AND type = 'P')
DROP PROCEDURE MyStoredProc
I checked that sysobjects is in user database and
INFORMATION_SCHEMA.ROUTINES is in master database system table.
It seems that SSMS uses SQL Server 2008 format to save stored
procedure in master database and SQL Server 2000 not.
It looks like I can not use SSMS stored procedure template to create
SQL Server 2000 stored prrocedure. SSMS template only for SQL Server
2005 and later.
Your help and information is great appreciated,
Regards,
iccsi