Saturday, 21 June 2014

Finding out Table in each Database of a Server


Below query is used to find out a particular table in each Database of a server.
It will loop through each database and checks for the particular table.

EXEC sp_Msforeachdb "use [?];select '[?]' as DatabaseName, * from sys.tables where name='TableName' "

No comments:

Post a Comment