![]() So far, Remus' answer looks most interesting. ![]() However, I want a single result set because I want a query that is essentially a "find" tool: if I add a clause like WHERE tablename like '%accounts' then it would tell me where to find my BillAccounts, ClientAccounts, and VendorAccounts tables regardless of which database they reside in.ΔΆ010.05.20 Update, about 20 minutes later. The above stored proc generates one result set per database, which is fine if you are in an IDE like SSMS that can display multiple result sets. This precludes the otherwise excellent answer from Pinal Dave: sp_msforeachdb 'select "?" AS db, * from. ![]() The catch, however, is that I would like a single result set. I am looking for T-SQL code to list all tables in all databases in SQL Server (at least in SS2005 and SS2008 would be nice to also apply to SS2000). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |