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();