Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    38

    Unanswered: Search Database for tables with specified column name

    Hi there,

    I am currently seaching a db for all tables that have the same column name, for example, 'qdate'. Can anyone let me know how I can write a script that will search a db for all tables with this column name 'qdate'?

    Thanks for your help!!!!!!

    From

    NewtoSql

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd use:
    Code:
    SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE 'qdate' = COLUMN_NAME
    Just for my own information, and partially to get Rudy's goat, I might even use * instead of table name.

    -PatP

Posting Permissions

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