SQL Server 2008 - Worth the Wait
One of the things we learn as beginning DBAs or Transact-SQL programmers is how to create and delete stored procedures. Later as our skills progress, we learn how to add or delete an association with an extended stored procedure to add a whole new world of functionality to our databases. SQL Server provides multiple documented and undocumented statements and system stored procedures that we can use to create new stored procedures, drop existing stored procedures, and associate/disassociate extended stored procedures in our databases (remember: extended stored procedure are only maintained in the master database).
Create a SQL Server Stored Procedure
Syntax CREATE PROC [ EDURE ] procedure_name [ ; number ] [ { @parameter data_type } [ VARYING ] [ = default ] [ OUTPUT ] ] [ ,...n ] [ WITH { RECOMPILE | ENCRYPTION | RECOMPILE , ENCRYPTION } ] [ FOR REPLICATION ] AS sql_statement [ ...n ]
Add (associate) a SQL Server Extended Stored Procedure
Syntax DBCC ADDEXTENDEDPROC ('@procname', '@dll')
Syntax sp_addextendedproc [ @functname = ] 'procedure' , [ @dllname = ] 'dll'
Drop a SQL Server Stored Procedure
Remove (disassociate) a SQL Server Extended Stored Procedure