Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2007
    Posts
    6

    Question Unanswered: same field name with different tables

    m using EmpName filed in lot of tables in sql server data base.

    how to write a query to find how many tables contains EmpName


    thanks in advance

    gowri

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Take a look at the syscolumns table
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    gowri, please stop re-posting the same question!! especially in the wrong forums!!

    see http://www.dbforums.com/showthread.php?t=1622646

    and george, syscolumns is ~so~ last century
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What's wrong with syscolumns?
    George
    Home | Blog

  5. #5
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    doesn't work in sql server 2005
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    It works on the 2005 box I play on...

    Anyhow, how come we're letting this thread stay? It's been posting at least 3 times already, and it's in the wrong place!
    George
    Home | Blog

  7. #7
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    ah, well, then i guess i was misinformed

    still, it's always better to use the features that were intended for that purpose, especially if they are standard sql, n'est-ce pas?
    Quote Originally Posted by daManual
    Information schema views are based on catalog view definitions in the SQL-92 standard. They present the catalog information in a format that is independent of any catalog table implementation and therefore are not affected by changes in the underlying catalog tables. Applications that use these views are portable between heterogeneous SQL-92 compliant database systems.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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