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
satheesh dPosted Nov 23, 2021, 10:33 AM
tejal bhesaniyaPosted Jul 30, 2012, 3:04 AM
Naresh AvariPosted Jul 18, 2012, 11:30 PM
EXEC sp_tables @table_type = "'table'"
Jignesh TrivediPosted Jul 18, 2012, 11:29 PM
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.