如何循環刪除臨時表?
name = tbb[i]关键是这里不知道如何写
for( int i=1;i<=8;i++)
{
string yu7= "select count(*) from sysobjects where name = tbb[i] and type = 'U' ";
SqlCommand gh7 = new SqlCommand(yu7, con);
if((int)gh7.ExecuteScalar() >= 1)
{
SqlCommand tb7 = new SqlCommand("drop table tbb[i] ", con);
tb7.ExecuteNonQuery();
}
}
for( int i=1;i<=8;i++)
{
string yu7= "select count(*) from sysobjects where name = tbb"+i.ToString()+" and type = 'U' ";
SqlCommand gh7 = new SqlCommand(yu7, con);
if((int)gh7.ExecuteScalar() >= 1)
{
SqlCommand tb7 = new SqlCommand("drop table tbb"+i.ToString()+" ", con);
tb7.ExecuteNonQuery();
}
}