Viewing 15 posts - 8,536 through 8,550 (of 10,144 total)
GSquared is right - you need those SELECT (SELECT constructs in there as he describes.
Also, the final query is missing SELECT [columnlist].
April 7, 2009 at 3:05 pm
Sure, briefly (it's nearly 10pm here).
Everything above this line [Troubleshoot from here down04-07-09] makes sense, nothing makes sense below the line. I'm guessing it should read something like
INSERT INTO...
April 7, 2009 at 2:45 pm
My mistake Donato, the top line was eaten:
DECLARE @Startdate DATETIME, @Enddate DATETIME
SELECT @Startdate = convert(datetime, '02-APR-09' + ' 03:00:00', 101),
@Enddate = convert(datetime, '02-APR-09' + ' 20:00:00', 101)
--
SELECT itl.user_id,...
April 7, 2009 at 2:16 pm
Can you run this please, with and without the derived table which is currently commented out, and post back the run times:SELECT @Startdate = convert(datetime, '02-APR-09' + ' 03:00:00',...
April 7, 2009 at 1:58 pm
Stephen, what do you get when you run this:
SELECT *
FROM co_customer_x_address
where cxa_cst_key = '18599564-1e26-4f0d-b95b-000d09d32406'
April 7, 2009 at 1:49 pm
Stephen crocker (4/7/2009)
Nope, that only updates the single record that already has the cxa_on_hold_flag
What value does it have for cxa_adr_key?
April 7, 2009 at 12:55 pm
Change this...
---
d.loginTime,
---
d.loginTimeSeconds,
---
d.LogoutTime
---
to this...
---
MAX(d.loginTime) AS loginTime,
---
MAX(d.loginTimeSeconds) AS loginTimeSeconds,
---
MAX(d.LogoutTime) AS LogoutTime
---
April 7, 2009 at 11:16 am
Try this, Donato:
DECLARE @Startdate DATETIME, @Enddate DATETIME
SELECT @Startdate = convert(datetime, '02-APR-09' + ' 03:00:00', 101),
@Enddate = convert(datetime, '02-APR-09' + ' 20:00:00', 101)
--
SELECT itl.user_id, au.notes, au.shift,
--
sum(update_qty * m.avg_cubes)...
April 7, 2009 at 11:03 am
Haha that's okay mate, none of the speedy-up stuff has been done yet! 😀
April 7, 2009 at 10:21 am
Ramesh (4/7/2009)
April 7, 2009 at 10:19 am
No worries Flo. I wondered where you'd got to - you were right on the ball, then disappeared:w00t:
April 7, 2009 at 9:44 am
jbuttery (4/7/2009)
The link on the bottom of your posts is incorrect. It should be http://www.sqlservercentral.com/articles/Best+Practices/61537/
I finally read it and apologize for my post,...
April 7, 2009 at 9:42 am
As Grant and GSquared have pointed out, there's abundant scope for improvement in this query, to make it fast and to make it pretty. Here's the first query of the...
April 7, 2009 at 9:37 am
That's it, but I've got a sneaky suspicion that the CAST has to be to VARCHAR, otherwise the zero prefix won't work.
SELECT ReviewDate, Hub, BankNumber, BranchNumber, AccountNumber =
RIGHT('00000000000000000'...
April 7, 2009 at 8:45 am
RIGHT('00000000000000000' + CAST(CAST('000000005121321212' AS BIGINT) + 1 AS VARCHAR(18)), 18)
April 7, 2009 at 8:26 am
Viewing 15 posts - 8,536 through 8,550 (of 10,144 total)