Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Set Showplan_xml Problem Expand / Collapse
Author
Message
Posted Monday, May 10, 2010 9:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, May 17, 2010 6:02 AM
Points: 7, Visits: 23
Hi,

I'm executing following query from C# code.

Set Showplan_xml on\rGo\r--Query--\rGo\rSet Showplan_xml off\rGo

So that it will be executed as
Set Showplan_xml on
Go
--Query--
Go
Set Showplan_xml off
Go

But I'm getting error that
Incorrect Syntax near 'Go'
The SET SHOWPLAN statements must be the only statements in the batch.


If i execute the same query in sql server it is working fine.
Post #919102
Posted Monday, May 10, 2010 9:32 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 12:34 PM
Points: 31,181, Visits: 15,626
What's in the query? Can you post it?






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #919120
Posted Monday, May 10, 2010 9:41 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 7:41 AM
Points: 1,191, Visits: 9,887
Go is not a T-SQL command, it's syntax used in Management Studio to signal the end of a batch. If you're submitting it from a .Net application, you have to submit the batches separately yourself.
Post #919127
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse