List all user tables and columns in a database.

List all columns in all tables in a SQL Server 2000 database.

SELECT SO.NAME, SC.NAME
FROM SYSOBJECTS SO INNER JOIN SYSCOLUMNS SC
ON SO.ID = SC.ID
WHERE SO.XTYPE = 'U'
ORDER BY SO.NAME, SC.NAME


List all columns in all tables in a SQL Server 2005 database.
SELECT SO.NAME, SC.NAME
FROM SYS.OBJECTS SO INNER JOIN SYS.COLUMNS SC
ON SO.OBJECT_ID = SC.OBJECT_ID
WHERE SO.TYPE = 'U'
ORDER BY SO.NAME, SC.NAME

Comments
FYI, you can get this same info in CF8 using the new cfdbinfo tag...and it will work for whatever datasource.
# Posted By Brian Rinaldi | 10/16/07 4:40 PM
LOL, yeah but it is useful when you inherit a 60 GB database without any documentation.
Oh well...
# Posted By Anson | 10/16/07 5:47 PM
Yes This is Execute and given Result is OK Fine
# Posted By Rohidas R Kumbharkar | 11/26/08 12:12 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner