• List all user tables and columns in a database.

    October 16, 2007 04:02 PM

    SQL

    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
    Posted by: Anson

Comments

  • Posted by: Brian Rinaldi  | October 16, 2007 04:40 PM
    FYI, you can get this same info in CF8 using the new cfdbinfo tag...and it will work for whatever datasource.
  • Posted by: Anson | October 16, 2007 05:47 PM
    LOL, yeah but it is useful when you inherit a 60 GB database without any documentation. Oh well...
  • Posted by: Rohidas R Kumbharkar | November 26, 2008 12:12 PM
    Yes This is Execute and given Result is OK Fine

Add Your Own Comment

;