• Good article. 

    I find using the system table invaluable.  I thought I would share a simple query of the system tables that I use to find tables and columns where I supply a portion of what I might think a column name would contain.  I find this quite useful when you have a large, complex database and you don't know exactly which tables you may want to look in...much easier than using Enterprise Manager.

    DECLARE @Column sysname

    SELECT @Column = UPPER ('%STRING%') 

    -- Replace 'STRING' with the portion of the column name you wish to search for

    --

    SELECT sysobjects.name AS Table_name, sysobjects.xtype, syscolumns.name AS Column_name, systypes.name AS Column_Type, syscolumns.length AS Column_length, systypes.allownulls AS Column_nullable

    FROM sysobjects

    JOIN syscolumns ON sysobjects.id = syscolumns.id

    JOIN systypes ON syscolumns.xtype = systypes.xusertype

    WHERE  UPPER (syscolumns.name) LIKE @Column

    -- choose to limit to just tables, just views, or both by commenting out the ones you don't want

     AND sysobjects.xtype = 'U' -- tables only

    -- AND sysobjects.xtype = 'V' -- views

    -- AND sysobjects.xtype IN ('U', 'V') -- tables and views

    ORDER BY sysobjects.type, sysobjects.name