Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Trouble shooting cursor


Trouble shooting cursor

Author
Message
TryingToLearn
TryingToLearn
Valued Member
Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)Valued Member (74 reputation)

Group: General Forum Members
Points: 74 Visits: 444
I am wondering if Cursors translate query statements, I am getting alerts for high CPU usage(Session CPU time is 1685.042 seconds for session ###). The process is running on a SQL2008 Server, but originating on a sql2000 server, via a linked server call(i assume) application name is simply 'Microsoft SQL Server', Unfortunately my organization in the past used a very generic sql userid and so the credentials do not not narrow down where this comes from. I ran a trace on the process, which runs for 1.5 hours. and this is the code i am catching that repeats. and based on this code i can't locate the code/job/process submitting this. This just started two days ago, and no know claims to have changed anything.

the tbl0172 portion of this query is what i find troubling, does a cursor do some sort of translation on column names?

SELECT Tbl1072."LASTDAYWORKED_I" "Col1719",Tbl1072."BENADJDATE" "Col1718",Tbl1072."EMPLCLAS" "Col1677",Tbl1072."EMPLOYID" "Col1676" FROM "TECH"."dbo"."UPR00100" Tbl1072


declare @p1 int
set @p1=-1
declare @p2 int
set @p2=NULL
declare @p5 int
set @p5=557064
declare @p6 int
set @p6=98305
declare @p7 int
set @p7=NULL
exec sp_cursorprepexec @p1 output,@p2 output,NULL,N'SELECT Tbl1399."ADRSCODE" "Col2627",Tbl1399."EMPLOYID" "Col2626",Tbl1399."PHONE1" "Col2634",Tbl1399."ZIPCODE" "Col2633",Tbl1399."STATE" "Col2632",Tbl1399."CITY" "Col2631",Tbl1399."ADDRESS3" "Col2630",Tbl1399."ADDRESS2" "Col2629",Tbl1399."ADDRESS1" "Col2628" FROM "CAN"."dbo"."UPR00102" Tbl1399',@p5 output,@p6 output,@p7 output
select @p1, @p2, @p5, @p6, @p7
sqlsurfing
sqlsurfing
SSC-Enthusiastic
SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)SSC-Enthusiastic (167 reputation)

Group: General Forum Members
Points: 167 Visits: 1130
sorry please delete, I mis-read question.

--------------------------------------------------
...0.05 points per day since registration... slowly crawl up to 1 pt per day hopefully :-D
RTaylor2208
RTaylor2208
SSC-Addicted
SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)

Group: General Forum Members
Points: 486 Visits: 1114
This looks very like the type of code LYNQ \ Nhibernate generates. It may not be that someone has coded a cursor but the application is generating cursor code.

MCITP SQL 2005, MCSA SQL 2012
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search