Results 1 to 3 of 3

Thread: mssql 2k: how do i find a field in a database

  1. #1
    Join Date
    May 2005
    Posts
    111

    mssql 2k: how do i find a field in a database

    looking for an sp or tsql that will allow me to locate a specific field name in a database, eg. table that field exists in.

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    use yourdatabasename
    go
    declare @columnnametosearch varchar(128)
    --update the @columnnametosearch with your desired column
    set @columnnametosearch='name'
    select object_name(id) as Tablename,name as Columnname from syscolumns where name =@columnnametosearch

  3. #3
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

Posting Permissions

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