SqlConnection conn = new SqlConnection();
conn.ConnectionString = "";
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;  
cmd.CommandText = "
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[user]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[user]
create table user(id int,name nvarchar(8) )";
cmd.ExecuteNonQuery();  
posted on 2011-04-23 10:13  Black Bean  阅读(769)  评论(0编辑  收藏  举报