want to run a query which will give the Admin detail

  • 0 down vote favorite

    I have a Database dbMain where I keep record of Multiple Database

    dbMain(database) - > tblMain(table)

    ID , DatabaseName , TableName

    1 , Db1 , tblMember

    2, Db2, tblMember

    3, Db3, tblMember

    Now i want to run a query which will give the Admin detail

    (tblmember table -> UserType columnName )

    can someone suggest me how to write the above query which will take dbname + tablename from tblMain table and give me admin details

    Thanks

  • I think you're going to have to give us a bit more to work with than that.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You need to join the mentioned table "tblMain" with the details table (tblMember?). Use the column(s) that defines the relation between these tables in your join statement.

    SELECT ...

    FROM tblMain

    INNER JOIN tblMember

    ON tblMain.column_x = tblMember.column_y

    You don't give us all the details we need (table definition, sample data, desired output), so I can't give you a more clear answer.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply