From: laredotornado on
Hi,

I'm using MSSql Server 2005. My client is Oracle SQL Developer on Mac
10.6.3. My problem is that I'm trying to get the execution plan for a
slow query, but am having trouble. I'm trying this

set showplan_text on;
go;
SELECT BIO FROM dbo.ARTIST_BIO WHERE ARTIST_ID = @P0;
go;

but getting errors ...

line 1: SQLPLUS Command Skipped: set showplan_text on

Error starting at line 2 in command:
go
Error report:
Unknown Command

Error starting at line 3 in command:
SELECT BIO FROM dbo.ARTIST_BIO WHERE ARTIST_ID = 2
Error at Command Line:3 Column:0
Error report:
SQL Error: Conversion failed when converting the nvarchar value
'P 3' to data type int.

Error starting at line 4 in command:
go
Error report:
Unknown Command


Any ideas? - Dave
From: Erland Sommarskog on
laredotornado (laredotornado(a)zipmail.com) writes:
> I'm using MSSql Server 2005. My client is Oracle SQL Developer on Mac
> 10.6.3. My problem is that I'm trying to get the execution plan for a
> slow query, but am having trouble. I'm trying this
>
> set showplan_text on;
> go;
> SELECT BIO FROM dbo.ARTIST_BIO WHERE ARTIST_ID = @P0;
> go;
>
> but getting errors ...
>
> line 1: SQLPLUS Command Skipped: set showplan_text on
>
> Error starting at line 2 in command:
> go
> Error report:
> Unknown Command

I would suggest that you ask in an Oracle forum how you would use
Oracle SQL Developer against SQL Server. Juding from the error messages,
it seems that it still validates the code as if it is Oracle SQL, which
means that you will not be able use Microsoft specific commands like
SET SHOWPLAN_TEXT ON.

"go" is another special creature. This is not an SQL command, but
SQL Server-oriented tools conventionally use this a batch separator
sends text separated by "go" in different batches to SQL Server.

I'm afraid of that I don't know of any SQL Server tools that runs on
Machintosh, but I have never looked. Maybe you should find a Windows
machine with SQL Server Management Studio on.
--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx