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?
create view v1
select top 5 * from Name
create view v2
select top 6 * from Name