how can i check whether a table exists in the database (ACCESS or SQL) in C# -


i found lot of questions regarding question.

but there simple statements accomplish task?

for both sql , access

if (exists (select 1 sys.tables name = 'table_name')) begin     -- stuff end 

sys.tables can give information table object, e.g. is_replicated column tells if table created replication or has_replication_filter column tells if table has replication filter set up

nb: sql server

edit: access:

select count(*) exists msysobjects  type = 1 , name = 'my_table_name'  

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -