bool exists; var chktb = new SqlCommand("select case when exists(select table_schema,table_name from information_schema.tables where schema_name='inventoryDB.mdf' and table_name='dbo.tempoutlet')", con); exists = (int)chktb.ExecuteScalar() == 1;
SELECT CASE WHEN OBJECT_ID('dbo.MyTable', 'U') IS NOT NULL THEN 1 ELSE 0 END
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)