DESC not working in SQL Server 2014 Management Studio

610    Asked by ChrisDyer in SQL Server , Asked on Apr 16, 2021

I want to execute DESCRIBE query to view database table, but i am not able to as it shows error 'Incorrect syntax the keyword DESC' Query : DESC 'table-name' What is DESC in SQL server?

Answered by Csaba Toth

DESC in SQL server:

DESC or describe command shows the structure of the table which includes the name of the column, data-type of the column, and the nullability which means, that column can contain null values or not. All of these features of the table are described at the time of the creation of the table. You should use sp_help to get what you want. This is SQL Server, not Oracle. use yourDB; exec sp_help 'yourTable'; sp_help (Transact-SQL) Reports information about a database object (any object listed in the sys.sysobjects compatibility view), a user-defined data type, or a data type. This sp only reads table metadata, it does not modify anything.






Your Answer

Interviews

Parent Categories