This is my script in C#
:
exec sp_executesql N'
IF OBJECT_ID(N''RealEstate.vwContract'', N''V'') IS NOT NULL
DROP VIEW RealEstate.vwContract
CREATE VIEW RealEstate.vwContract
AS
SELECT RealEstate.Contract.ID .... (Rest of Statement omitted for brevity)
The error shows up:
Msg 111, Level 15, State 1, Line 1
'CREATE VIEW' must be the first statement in a query batch.
Please help me.
GO
after dropping a view? – Dominic Zukiewicz Jun 18 '13 at 9:07GO
is a white lie introduced by tools like SSMS;GO
is not part of the SQL language, but is used by some tools to split a single file into multiple commands – Marc Gravell♦ Jun 18 '13 at 9:16