May be you can try instead:
SELECT
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
conclusion:
I try the statement exec xp_msver 'ProductVersion'
via ODBC in combination with the driver "Sql Server". If I try this, I get the error message " Error requesting "xp_msver" (procedure) because "xp_msver" is a procedure object. ". The statement itself can be executed in SQL Management Studio without any problems.
What i know:
I found out through the XPS Profiler that the ODBC driver makes the following from the statement:
declare @p1 int set @p1=0 declare @p3 int set @p3=8 declare @p4 int set @p4=8193 declare @p5 int set @p5=0 exec sp_cursoropen @p1 output,N'exec xp_msver ''ProductVersion''',@p3 output,@p4 output,@p5 output select @p1, @p3, @p4, @p5.
This actually reproduces the problem. If I execute a statement like
declare @p1 int set @p1=0 declare @p3 int set @p3=8 declare @p4 int set @p4=8193 declare @p5 int set @p5=0 exec sp_cursoropen @p1 output,N'select GENERICCOLUMN from GENERICTABLE',@p3 output,@p4 output,@p5 output select @p1, @p3, @p4, @p5.
it works without any problems.
Question:
Does anyone know why the error occurs or does anyone know a workaround?
May be you can try instead:
SELECT
SERVERPROPERTY('Edition') AS Edition,
SERVERPROPERTY('ProductVersion') AS ProductVersion,
SERVERPROPERTY('ProductLevel') AS ProductLevel
Sounds like you are calling the stored procedure in the wrong way. My ODBC is rusty, but I think you should use SQLExecDirect. You should certainly not have any cursor.