日期:2014-05-18  浏览次数:20527 次

关于执行多条drop view,create view语句的问题
有如下语句:
SQL code

drop view tablename
go
create view tablename as
    select * .....
    ......


drop view tablename2
go
create view tablename2 as
    select * .....
    ......



单独执行一段语句,如

SQL code

drop view tablename
go
create view tablename as
    select * .....
    ......


没有任何问题,但是一起执行的时候总提示我drop附近或者create附近有语法错误,到底怎么一回事?

------解决方案--------------------
go
drop view tablename
go
create view tablename as
select * .....
......

go
drop view tablename2
go
create view tablename2 as
select * .....

这个你试试

------解决方案--------------------
SQL code

drop view tablename
go
create view tablename as [...]
go
drop view tablename2
go
create view tablename2 as [...]
go

------解决方案--------------------
drop view tablename

go

create view tablename as
select * .....
......

go

drop view tablename2

go

create view tablename2 as
select * .....
......

go