Sample Header Ad - 728x90

Neatly print sp_help output similar to psql \d+

0 votes
1 answer
310 views
I've just been granted access to a SQL Server data warehouse and I'm trying to get to grips with sqlcmd. Coming from a Postgres/psql background, I'm used to being able to quickly look up a table definition using short cuts like \d+ [tablename]. This produces a nice, single screen vertical summary of the table columns, datatypes and constraints. Something like this: \d+ example The equivalent I've found so far is EXEC sp_help 'table_name' but this prints an unreadable, multi-page mess. Is there a way to clean up this output? Is there a better TSQL command that will give a simple table summary?
Asked by Matt (291 rep)
Jul 31, 2023, 09:14 PM
Last activity: Jul 31, 2023, 09:24 PM