Skip to main content

Describe the tables in MSSQL

There is no query to get the description of the table like in MySQL. Use sp_columns stored procedure to describe the table in SQL Server.

           exec sp_columns tableName;

And also we can use sp_help to describe the table. sp_help is returned depend on whether name is specified, when it is specified, and what database object it is.

           exec sp_help tableName;         

Comments

Popular posts from this blog

Get all constraints in Oracle

 To get all the constraints created in Oracle database, use below query.              SELECT * FROM USER_CONSTRAINTS; If you want to get the constraints  created for a particular user then use below SQL query.              SELECT   *   FROM  USER_CONSTRAINTS where owner = 'userName';