Sql-server – nybody using the SQL Server feature to create groups of stored procedures differentiated by number

sql serverstored-procedures

The question refers to the number parameter in this msdn documentation

If you don't you can create multiple stored procedures in SQL-Server differentiated by number and drop them with a single drop.

create procedure dbo.stored_proc1 as select 1
go
create procedure dbo.stored_proc1;2 as select 2
go
exec stored_proc1
-- returns 1
go
exec stored_proc1;2
-- returns 2
go
drop stored_proc1
-- drops both 
go

I wonder if this feature is used by anybody for something useful or if it is just a historic curiosity.

Best Answer

I used this feature about 6 years ago. You are right, we cannot do this:

drop stored_proc1;2

and

exec stored_proc1 

the same as

exec stored_proc1;1

Why did we use it? We have a lot of algorithms (strategies) to calculate data, so we can easily switch between versions without changing the call interface.