views:

38

answers:

1

We have some legacy stored procedures that use the now deprecated feature of SQL Server that allowed you to create multiple versions of a procedure within a procedure.

For instance we have..

[up_MyProc]
[up_MyProc];2

You can still create these "versions" by appending the version on the end of the name. However without dropping the procedure we'd like to drop the internal versions.

You cant seem to do

DROP PROC [up_MyProc];2
DROP PROC [up_MyProc;2]

Is there a way to drop the internal versions?

A: 

Unfortunately, no.

I've just tried sp_rename which failed too.

The new system views do not detect them either

CREATE PROC DBO.FOO;1
AS
SELECT 1
go

CREATE PROC DBO.FOO;2
AS
SELECT 2
go

--Can't find using new system views
SELECT * FROM sys.objects WHERE name LIKE '%foo%'
SELECT * FROM sys.sql_modules WHERE definition LIKE '%dbo.foo%SELECT%'
GO
--Found using legacy "system tables"
SELECT * FROM sysobjects WHERE name LIKE '%foo%'
SELECT * FROM syscomments WHERE text LIKE '%dbo.foo%SELECT%'
GO
gbn