Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.
declare @objcursor as cursor declare @iteStatus nvarchar(2), @ite2tatus nvarchar(2), @vsql nvarchar(max), @vquery nvarchar(max), @unit nvarchar(10), @featNo nvarchar(10) set @vquery = 'select c.iteStatus,c.ite2tatus,c.unit,c.featNo from '+@tab_nm+' i,obj2 a,objs c where isnull(i.EVENT_TYPE,'''') ' +'in(''A'',''D'',''M'') and isnull(i.UPDATE_STATUS,'''')=''R'' and i.obj_UNIT=a.Unit and i.obj2No=a.obj2No ' +'and a.UNIT=c.Unit and a.featNo=c.featNo order by i.EVENT_TIMESTAMP' set @vsql = 'set @cursor = cursor forward_only static for ' + @vquery + ' open @cursor;' exec sys.sp_executesql @vsql ,N'@cursor cursor output' ,@objcursor output ...
Msg 16950, Level 16, State 2, Procedure p_upd_cust_status, Line 22 The variable '@objcursor' does not currently have a cursor allocated to it.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.