May 2006
Intermediate to advanced
536 pages
15h 13m
English
SQL Server 2005 supports different types of stored procedures: user-defined, system, and extended. You can develop user-defined stored procedures with T-SQL or with the CLR. This section briefly covers the different types.
A user-defined stored procedure is created in a user database and typically interacts with the database objects. When you invoke a user-defined stored procedure, you specify the EXEC (or EXECUTE) command and the stored procedure’s schema-qualified name, and arguments:
EXEC dbo.usp_Proc1 <arguments>;
As an example, run the code in Example 7-1 to create the usp_GetSortedShippers stored procedure in the Northwind database:
Example 7-1. Creation Script for usp_GetSortedShippers ...
Read now
Unlock full access