sb = new StringBuilder();
sb.Append(@"use master
if exists(select * from sysdatabases where name='RemPacs_1')
drop database RemPacs_1
create database RemPacs_1
use RemPacs_1
if exists(select * from sysobjects where name='GLB_AgeUnit')
drop table GLB_AgeUnit
create table GLB_AgeUnit
(
AgeUnitID int not null primary key,
[Name] nvarchar(4) not null,
DisplayNo int not null
)
insert into GLB_AgeUnit (AgeUnitID,[Name],DisplayNo) values(1,'岁',1)
insert into GLB_AgeUnit (AgeUnitID,[Name],DisplayNo) values(2,'月',2)
insert into GLB_AgeUnit (AgeUnitID,[Name],DisplayNo) values(3,'周',3)
insert into GLB_AgeUnit (AgeUnitID,[Name],DisplayNo) values(4,'天',4)
insert into GLB_AgeUnit (AgeUnitID,[Name],DisplayNo) values(5,'时',5)");
SqlCommand cmd = new SqlCommand(sb.ToString(), GetConnection());
int i = cmd.ExecuteNonQuery();
l路径 调用。。(传参)
调试一下看看在DBS里查看一下哪里有没有报错
把多语句一起传过去执行,在每个完整的SQL语句后面加上;
否则识别不了
我给你写了个例子 发给你消息了