Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
DiceK-BadMan
Starting Member
12 Posts |
Posted - 2007-11-01 : 17:38:00
|
Hello...I'm trying to figure out how can I make a query of finding a specific table within a server that has a hundreds of database..I know its to simple too answer but I'm curious..Thanks for helping me... |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-11-01 : 17:55:01
|
[code]DECLARE @sql NVARCHAR(500), @tableName NVARCHAR(128)SELECT @tableName = '%Address%', @sql = 'use ?; select * from Information_schema.tables where table_name like ''' + @tableName + ''''exec sp_MsForEachDb @sql[/code]_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
DiceK-BadMan
Starting Member
12 Posts |
Posted - 2007-11-01 : 17:57:45
|
Thanks for the code spirit1.. |
 |
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2007-11-02 : 00:02:55
|
Or, in Query Analyzer, press the {f4} key.--Jeff Moden |
 |
|
|
|
|