Results 1 to 3 of 3

Thread: find a column in all the table

  1. #1
    Join Date
    Nov 2002
    Posts
    231

    find a column in all the table

    Hi,
    I need to find the text data type column in all the table.
    Please let me know the script.
    Thanks,
    Ravi

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    select 'select "'+a.name+ '",'+ b.name+' from ' + a.name from sysobjects a,syscolumns b, systypes c where
    a.id = b.id and c.xtype=b.xtype and c.xtype in (35) and a.type ='u'
    go


    Execute the above statement it will give you all the table names and column names with text datatype.

  3. #3
    Join Date
    Nov 2002
    Posts
    231
    Mak,
    Thanks for the query.
    Here is another query i have found.

    select c.name colum_name ,t.name data_type, o.name table_name from syscolumns c,sysobjects o,systypes t
    where c.id=o.id
    and o.type = 'U'
    and c.xtype = t.xtype
    and c.xtype in (35)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •