code_junkie

How do you show a list of tables in another database?

Nov 13th, 2011
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. select * from your_database_name.sys.tables
  2.  
  3. use a;
  4. go
  5.  
  6. select * from sys.tables; -- selects table info from a
  7. select * from b.sys.tables; -- selects table info from b
  8.  
  9. select * from your_database_name.information_schema.tables
Add Comment
Please, Sign In to add comment