Skip to content

Mr SQL's Blog

Musings on Microsoft SQL Server

sp_help is an invaluable inbuilt SQL Server procedure that returns information on a number of different objects. Here are some examples of its use:-



without specifying a context returns a list of all objects within the current database. The name, owner and object type are returned. Additionally, any user defined data types within the database are listed:-



sp_help tablename

returns information relating to the table. The first results set provides information relating to the table itself. The second results set provides information on the columns, such as data type and data length. Beneath that are information on identity columns, GUIDs, filegroup location, indexes, constraints and foreign key references:-


Try running sp_help against other objects (indexes, columns, filegroups, constraints, procedures, functions) to see what useful information you can gather.


Tags: , , , ,

%d bloggers like this: