Check if a SQL table exists

后端 未结 9 2312
北海茫月
北海茫月 2020-12-01 06:30

What\'s the best way to check if a table exists in a Sql database in a database independant way?

I came up with:

   bool exists;
   const string sql         


        
9条回答
  •  無奈伤痛
    2020-12-01 06:48

    In current project on my job I need to write 'data agent' which would support a lot of database types.

    So I decided to do next: write a base class with the base (database independent) functionality using virtual methods and override in subclasses all database-specific moments

提交回复
热议问题