Benefits of Stored Procedures

As you've worked through this book, you've learned to use a number of stored procedures to get information about system objects or about the status of SQL Server. Some of those stored procedures include

  • sp_help

  • sp_helptext

  • sp_helpdb

  • sp_helprotect

  • sp_helpuser

These procedures are used for reporting and provide several benefits. First, they enable us to extract useful information from the server even though we don't really understand the structure of the tables themselves. Look at sp_help. It draws information from sysobjects, syscolumns, systypes, sysindexes, and master..spt_values.

Second, procedures reduce your workload by reducing the amount of typing and maintenance you must perform. The sp_help procedure ...

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.