Q&A

Q1: Where are stored procedures stored?
A1: A stored procedure is a database object, so it is stored in the database in which it is created. There are references to a stored procedure in several system tables, including sysobjects (one line per procedure), syscolumns (one line per parameter), sysdepends (one line per referenced table, view, or procedure), and syscomments (one line per block of 255 characters of source SQL).
Q2: Is a stored procedure faster than a batch?
A2: Tomorrow, we'll look more closely at procedure performance issues. For now, I'll say, "Yes, most of the time."
Q3: How do I get a list of all stored procedures in the system?
A3: On a database-by-database basis, you can execute this statement to retrieve a list ...

Get Sams Teach Yourself Transact-SQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.