cancel
Showing results for 
Search instead for 
Did you mean: 

Mobilink - Executing SQL directly; no cursor.

Former Member
3,950

Hello again,

We've been seeing a lot of warnings in the LogML.txt file, containing the message Executing SQL directly; no cursor., as show below:

W. 2017-04-10 15:36:34. <8> [10050] ODBC: [Microsoft][SQL Server Native Client 11.0][SQL Server]Executing SQL directly; no cursor. (ODBC State = 01000, Native error code = 16954)

After some analysis it seems to be related to download cursor of tables which contains columns of long-length types, like long varchar and long binary. Using a SQL profiler I concluded that for these tables (and only these tables) the following SQL command is executed:

declare @p1 int
set @p1=NULL
declare @p2 int
set @p2=0
declare @p5 int
set @p5=4104
declare @p6 int
set @p6=8193
declare @p7 int
set @p7=0
exec sp_cursorprepexec @p1 output,@p2 output,N'@P1 datetime2,@P2 varchar(128)',N' EXEC MySyncProc @LastDownload = @P1, @idMobileDB = @P2',@p5 output,@p6 output,@p7 output,'2017-04-07 15:16:26.4200000','3147'
select @p1, @p2, @p5, @p6, @p7

However, for other tables the command sp_prepexec is called instead, as follow:

declare @p1 int
set @p1=NULL
exec sp_prepexec @p1 output,N'@P1 datetime2,@P2 varchar(128)',N' EXEC MySyncProd2 @LastDownload = @P1, @idMobileDB = @P2','2017-04-07 15:16:26.4200000','3147'
select @p1

Questions:

  1. Why sp_cursorprepexec is called instead of sp_prepexec?
  2. Is this warning an error or Mobilink's fault? If not, can I get rid of it?

Accepted Solutions (0)

Answers (0)