If you like to get all the tables in a database which contains a column name you specified, then write the below queries and get it easily:
Reference: Govind Badkur(http://govindbadkur.blogspot.com)
SELECT C.name AS ColName, T.name AS TableNameFROM sys.columns CJOIN sys.tables TON C.object_id = T.object_idWHERE C.name LIKE '%MyColName%'--- Or...---SELECT COLUMN_NAME, TABLE_NAMEFROM INFORMATION_SCHEMA.COLUMNSWHERE COLUMN_NAME LIKE '%MyColName%'
Reference: Govind Badkur(http://govindbadkur.blogspot.com)
No comments:
Post a Comment