Hello,
I am trying to create 2 views in my SQL Server database using 1 statement eg:
create view View1 as select partnumber from Table1
Go
create view View2 as select * from table2
This works fins under SQL query analyser, but if i try to run it from code it gives the following error:
Incorrect syntax near 'GO'. 'CREATE VIEW' must be the first statement in a query batch
obviously it doesn't like the "go" keyword and removing this still causes an error. I can run 2 seperate statements but I would like to run it in one go if possible.
Anyone have any ideas?
Neil
I am trying to create 2 views in my SQL Server database using 1 statement eg:
create view View1 as select partnumber from Table1
Go
create view View2 as select * from table2
This works fins under SQL query analyser, but if i try to run it from code it gives the following error:
Incorrect syntax near 'GO'. 'CREATE VIEW' must be the first statement in a query batch
obviously it doesn't like the "go" keyword and removing this still causes an error. I can run 2 seperate statements but I would like to run it in one go if possible.
Anyone have any ideas?
Neil