Sql – the equivalent of ‘describe table’ in SQL Server

sqlsql server

I have a SQL Server database and I want to know what columns and types it has. I'd prefer to do this through a query rather than using a GUI like Enterprise Manager. Is there a way to do this?

Best Answer

You can use the sp_columns stored procedure:

exec sp_columns MyTable