This question already has answers here:
How can I show the table structure in SQL Server query? (10 answers)
Closed 2 days ago.
In MySQL it's pretty easy, just run DESC tablename; query and it shows the structure but doesn't work for SQL Server.
I tried the same thing.
1条答案
按热度按时间rt4zxlrg1#
If you want to know all the basic metadata about a table, you can use sp_help
exec sp_help 'dbo.SomeTable'
There are other catalog views like sys.tables, sys.columns, etc that you can query for specific details.
But most people use a GUI like SQL Server Management Studio that will display the table metadata in a treeview, or schema diagram.