SQL Server: Why would i add “;1” to the end of a stored procedure name?

前端 未结 3 1338
孤独总比滥情好
孤独总比滥情好 2021-01-11 11:04

i came across a compatibility issue today, as a customer upgraded from Windows XP to Windows 7.

The (12 year old code) is calling a stored procedure on the SQL Serve

3条回答
  •  广开言路
    2021-01-11 11:30

    • why were we appending ;1 to the end of the stored procedure name? (what does it accomplish)

    The ;1 means that you are calling Numbered Stored Procedures. You can have InsertOrders;1, InsertOrders;2, InsertOrders;3 as different versions with the same name. When you do a DROP on the InsertOrders, all numbered versions are dropped. This was a poor man's implementation of overloading.

    • why was the SQL Server driver ignoring it?

    The old SQL Server driver either knew what a numbered proc was, or was not smart enough to parse and compile that portion of code.

    • why was a breaking change made in Windows 7?

    • is the breaking compatibility change documented?

    This will not be supported in a future version, but R2 supports numbered stored procs. I have personally never put numbered procs in production - only played with them, said "oh cool" and moved on.

提交回复
热议问题