Use numbers in Stored Proc name  
Author Message
rossi141





PostPosted: Tue Apr 08 11:57:16 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name

Is there a compeling reason why one should NOT use a number at the end of a
stored procedure name like:

"SomeName2"

Thanks.

--


SQL Server257  
 
 
Anith





PostPosted: Tue Apr 08 11:57:16 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name Not really.

At some point in the past there was (or still is?) an option to name
multiple procedures with the same name with a number postfix like: usp;1,
usp;2 etc. for some reason nobody seemed to care.

--
Anith


 
 
Aaron





PostPosted: Tue Apr 08 11:55:26 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name Well, what does the 2 mean? If it is a better, improved version of the
stored procedure, then why not replace the original version? If the
functionality is different, then there must be some way to represent that
fact in the name.





> Is there a compeling reason why one should NOT use a number at the end of
> a stored procedure name like:
>
> "SomeName2"
>
> Thanks.
>
> --

>


 
 
Erland





PostPosted: Tue Apr 08 17:31:13 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name
> At some point in the past there was (or still is?) an option to name
> multiple procedures with the same name with a number postfix like: usp;1,
> usp;2 etc. for some reason nobody seemed to care.

There still is, but the feature is deprecated and may be slated for
removal in the version after SQL 2008.

As for the original question, I tend to use names like some_sp2 when I
want to install a test version of a stored procedure, to run in parallel
with the old.

But I guess that if you have two procedures where one is a wrapper on the
inner procedure (to handle some defaults like NULL meaing "today") you
may run out of ideas and call the inner procedure the same as the
outer with a 2 tacked on.


--


Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 
 
moondaddy





PostPosted: Tue Apr 08 18:43:56 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name Thanks to all the replies. The number on the end has nothing to do with a
version of the sp and is used for some other meaning. I just wanted to know
if there was a compelling reason why this was a bad idea such as some
conflict in sql server or transact sql.





>> At some point in the past there was (or still is?) an option to name
>> multiple procedures with the same name with a number postfix like: usp;1,
>> usp;2 etc. for some reason nobody seemed to care.
>
> There still is, but the feature is deprecated and may be slated for
> removal in the version after SQL 2008.
>
> As for the original question, I tend to use names like some_sp2 when I
> want to install a test version of a stored procedure, to run in parallel
> with the old.
>
> But I guess that if you have two procedures where one is a wrapper on the
> inner procedure (to handle some defaults like NULL meaing "today") you
> may run out of ideas and call the inner procedure the same as the
> outer with a 2 tacked on.
>
>
> --

>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


 
 
petery





PostPosted: Tue Apr 08 22:24:57 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name Hello,

As far as I know, I don't think there is a compelling reason that you
cannot use number as postfix of a SP name. If you encounter any problem,
please feel free to let's know. Thank you.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

 
 
Tibor





PostPosted: Wed Apr 09 01:50:42 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name Here's a pure technical viewpoint:

Having a number in the beginning of an identifier (object name for instance) makes it a non-standard
identifier. You would have to quote it when you refer to it, like (first alternative ANSI SQL
compliant):

EXEC "2myProc"
EXEC [2myProc]

Having a number anywhere else do not affect whether it is a standard identifier or not. For instance
below is a standard identifier (no quoting needed):

EXEC myProc2

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi




> Is there a compeling reason why one should NOT use a number at the end of a stored procedure name
> like:
>
> "SomeName2"
>
> Thanks.
>
> --

>


 
 
--CELKO--





PostPosted: Wed Apr 09 10:12:14 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name >> Is there a compelling reason why one should NOT use a number at the end of a stored procedure name <<

The name of a procedure name should be of the form "<verb<object>" and
explain what the intent of the procedure is -- "MakeNewCustomer",
"ReportMonthlyTotals", etc. If a number has such a meaning, then use
it. I cannot imagine a situation like that just off hand.

In the old Sybase days, you could have multiple versions of a
procedure that looked like "<proc name>;<integer>" but nobody used it
back then and most programmers don't know it exists today.
 
 
Aaron





PostPosted: Wed Apr 09 11:25:47 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name > Thanks to all the replies. The number on the end has nothing to do with a
> version of the sp and is used for some other meaning.

Does "some other meaning" have an equivalent English word other than "2"?

> I just wanted to know if there was a compelling reason why this was a bad
> idea such as some conflict in sql server or transact sql.

Nope. But it can make the meaning of the stored procedure very unclear to
all but the developer who wrote it. :-(

 
 
Shuurai





PostPosted: Wed Apr 09 11:40:19 CDT 2008 Top

SQL Server Developer >> Use numbers in Stored Proc name
> Is there a compeling reason why one should NOT use a number at the end of =
a
> stored procedure name like:
>
> "SomeName2"

Aside from the "2" being meaningless, not really. There is no
technical reason why you can't do that.

Of course, the guy who has to figure out at 3am what the difference is
between SomeName and SomeName2 might have something else to say :b