Пример #1
0
 public bool TableExists(string tableName)
 {
     using (ITransaction transaction = BeginTransaction(IsolationLevel.ReadUncommitted))
     {
         using (IDbCommand cmd = transaction.CreateCommand())
         {
             cmd.CommandText = "SELECT COUNT(ID) FROM SYSTEM.SYSTABLES WHERE NAME=@TABLENAME";
             DBUtils.AddParameter(cmd, "TABLENAME", tableName, DbType.AnsiString);
             long cnt = (long)cmd.ExecuteScalar();
             return(cnt > 0);
         }
     }
 }