Hi all,
I want to find whether a table exists in a database. I have only the database name and table name. Can anyone please tell me how to list all tables in a database so that I can find whether the table is present in the database?
Regards
Loading

Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 18, 2012, 7:29 PM EDT
there are two tables sys.tables and sys.objects, in which data base maintain table information
please try.
select * from sys.tables where name = 'Table1'
select * from sys.objects where type = 'U' and type_desc = 'USER_TABLE'
hope this will help you.
Naresh AvariRank #2,678 · 520 reputationPosted Jul 18, 2012, 7:30 PM EDT
EXEC sp_tables @table_type = "'table'"
tejal bhesaniya52 reputationPosted Jul 29, 2012, 11:04 PM EDT
satheesh d190 reputationPosted Nov 23, 2021, 5:33 AM EST