January 30, 2007 at 4:22 am
Hi all,
I am newbie to sql server 2000.
I am looking for some kind of method where i can create, say a library, of stored procedures / functions. A very similar to Oracle where i can define a package wherein i can define procedures / functions and can call any one of them whenever required.
I may sound absurd but any suggestions / solution, if any one can provide????
Thanks in advance.
NewBie
January 30, 2007 at 7:13 am
sql server does not have something like package in oracle. but u can nest your stored procedures upto a limit if 32 procedures called within a single procedure. u have to create ur procedures and functions separately in sql server.
Cheers,
Sugeshkumar Rajendran
SQL Server MVP
http://sugeshkr.blogspot.com
January 30, 2007 at 7:35 am
In SQL Server each stored procedure is like your own function and they can call each other, but htey are not "grouped" together in anyway. Instead you've had to use naming conventions to keep them organized.
January 30, 2007 at 8:54 pm
Hi all,
Thanks for the reply.
Actually, I was thinking in terms of creating some kind of library of stored procedures / functions which are very frequently used and related to each other so that they can be traced easily.
Anyway, Thanks to all.
Regards,
NewBie.
January 30, 2007 at 9:17 pm
Actually... there is a way... if you look in Books OnLine, the syntax for creating a stored procedure is....
CREATE PROC [ EDURE ] procedure_name [ ; number ]
[ { @parameter data_type }
[ VARYING ] [ = default ] [ OUTPUT ]
] [ ,...n ]
[ WITH
{ RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ]
[ FOR REPLICATION ]
AS sql_statement [ ...n ]
It's not quite the same as an Oracle package but if you say DROP PROCEDURE without the ;Number notation, all procedures of the same name will be dropped kinda like an Oracle package.
Read up on it in Books Online... might be close enough, might not.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply