MS SQL - Get the information about a table

By xngo on October 26, 2019

In MS SQL server, you can use sp_help command to get the information about a database object. It provides information about:

  • Column data type definition.
  • Primary keys.
  • Index names.
  • Foreign key constraints.

I mostly used it to find the foreign key constraints about a table. Here is an example.

sp_help Contacts

Output

MS SQL Server - sp_help Contacts

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.