Reputation: 4284
I'm having a strange error using dotnet SqlCommand
.
Basically I'm executing a command text that has a multi-line comment with a GO
in there ex:
/*IF OBJECT_ID ( 'dbo.xxx', 'P' ) IS NOT NULL
DROP PROCEDURE [dbo].[xxx]
GO
*/
select * from dbo.abc
The error that I got was "Missing end comment mark '*/'"
I was able to narrow down the error and it seems that the problem is related with the GO
. If I remove the G
O It works.
If I execute this command and watch the executed query in sql profile I get:
/*IF OBJECT_ID ( 'dbo.xxx', 'P' ) IS NOT NULL
DROP PROCEDURE [dbo].[xxx]
So part of the query wasn't executed... and end comment mark is missing
I've search to see if anyone was having this problem as I've saw this post on msdn with a similar GO
problem...
am I the only one with this problem? Is there a workaround?
Upvotes: 0
Views: 563
Reputation: 280262
I fail to see the point, but the problem is the GO
. GO
is not Transact-SQL, it's a batch separator for tools like SSMS. Try it without the GO
(or without a multi-line comment, or any comment, in the first place).
Upvotes: 4