I am trying to generate a showplan table in SQL Server. I am getting this error when I try to do this
Msg 1067, Level 15, State 1, Line 0
The SET SHOWPLAN statements must be the only statements in the batch.
I tried on a simple query and the error still appear
Use Warehouse
SET SHOWPLAN_ALL ON;
GO
SELECT * FROM [Warehouse].[dbo].[Client]
GO
SET SHOWPLAN OFF;
GO
What exactly does the error mean by only statements in the batch
? Removing the GO
did not resolve the issue too (I thought GO created "batches"). Could this be due to SQL server rights?