purplesoup
asked on
Creating a SQL Script (batch) file with multiple create view statements
I want to create a Microsoft SQL script file that creates multiple views in a database, and can be run multiple times without an error.
Is this possible. The code below will work, but it won't run a second time without an error. If I add an existence check I get an error that the create view statement isn't the first in the batch, is there a way around this problem?
Is this possible. The code below will work, but it won't run a second time without an error. If I add an existence check I get an error that the create view statement isn't the first in the batch, is there a way around this problem?
create view v1
as
select top 5 * from Name
go
create view v2
as
select top 6 * from Name
go
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.