The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Thanks for all, my challenge is the below code. If I am not using it then SP is taking 6 seconds to get data and after using it, taking more then 1 min
Please do you have any idea to optimize it
Set DriverID = FDR.DriverID,
CompanyID = CDT.CompanyName
from @TempTable1 TMP1
Inner Join (Select FaxID, CompanyID, LTrim(Replace(Stuff((Select ', ' + ISNULL(Cast(FD1.DriverID as varchar(10)),'') From FaxId_Document_Relation FD1 Where FD1.FaxID = FD2.FaxID For XML PATH ('')),1,1,''),' ,','')) as DriverID
From FaxId_Document_Relation FD2
Where FaxID in (select FaxID from @TempTable1)
Group By FaxID, CompanyID) as FDR ON TMP1.FaxID = FDR.FaxID
--Inner Join CustomerDetails CDT on CDT.CompanyID = FDR.CompanyID --Anoop
Inner Join (select CompanyID, CompanyName from CustomerDetails) as CDT on CDT.CompanyID = FDR.CompanyID
Start by reading the text at the top of the page and you will see in bright red letters that this isn't the place for technical queries. So if you want to make people happy, post this in the right place. Happy people give better help than annoyed ones do...
did you assume does not apply to you?
You have been told, you ignore it.
You are showing yourself to be rude, arrogant, and uncaring. Why the heck should we try to help you if you just assume that the rules do not apply to you?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
Last year was "The Year of the Hip" as in I had both of my hips replaced. One in June, the second in November. Lot's of PT but both successful - ZERO hip pain today.
A week and a half ago I had the first knee replacement done. Unlike the hips it was done on an outpatient basis. Arrived at the surgical center at 5:30am, surgery complete by 9:00am, discharged around 1:30pm. Crazy!
Used crutches for a few days and opioids for a few more days. PT is harder with a knee than it was with the hip but it's not brutal (yet).
Not sure when exactly I'll do the second knee but probably sooner rather than later. I can't wait to be able to walk without pain.
In and out in a day for a knee replacement is pretty quick. In NZ they like you to be in hospital for a few days as one critical aspect of recovery is the right exercises by physios to get the joint working as quickly as possible. Without the exercises the recovery can take significantly later then it should.
Good luck. I hope all goes well.
A Fine is a Tax for doing something wrong
A Tax is a Fine for doing something good.
Last Visit: 23-Oct-20 2:19 Last Update: 23-Oct-20 2:19