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();
C#动态创建表
程序员文章站
2023-12-28 11:52:52
...
转载于:https://www.cnblogs.com/blackbean/archive/2011/04/23/2025486.html