How To List All Columns In All User Tables In A Sql Server Database


Have you ever wanted to list all columns in all User tables that exist in a SQL Server Database?



SELECT "table", "column", sm.text "Default" 
FROM dbo.sysobjects so INNER JOIN dbo.syscolumns sc ON = 
LEFT JOIN dbo.syscomments sm ON sc.cdefault =  
WHERE so.xtype = 'U'  
ORDER BY so.[name], sc.colid



There are no notes on this topic