Viewing 15 posts - 16 through 30 (of 38 total)
Next time a mistake like that happens, it's OK to just edit the post. 🙂
Also, it's much easier to read a query when it's posted inside a sql code block....
October 14, 2011 at 11:21 pm
What I do for my Rebuild Index maintenance tasks is that I perform the following steps:
1. Backup the transaction log
2. Change the recovery model to Bulk-logged
3. Execute the index Rebuild...
October 14, 2011 at 8:26 am
How about using RANK() OVER?
See how this performs:
WITH FullResults (RecordsDate, RecordsJoinValue, MoreRecordsDate, MoreRecordsJoinValue,MoreRecordsValue, MoreRecordsRank)
AS
(
SELECT #Records.[Date] AS RecordsDate
, #Records.JoinValue AS RecordsJoinValue
, #MoreRecords.[Date] AS MoreRecordsDate
, #MoreRecords.JoinValue AS MoreRecordsJoinValue
, #MoreRecords.Value AS MoreRecordsValue
, RANK()...
October 13, 2011 at 10:02 am
The OP made no mention of sending an email per each result, which is why a set based solution was recommended.
Unfortunately, I don't think there currently is a purely set-based...
October 13, 2011 at 9:10 am
Thanks for all your replies and help everyone!
@mister.magoo
Ah, I see your point now. This is not a RBAR problem. I'm grateful for your input. The reason that I'm so...
September 6, 2011 at 11:28 am
@mister.magoo
In this case, each select statement is returning a single row, instead of a set. While the UNION method works, in the long-term it will simply become another method that...
September 3, 2011 at 9:10 pm
I'm simply trying to figure out why the RBAR solution to this problem is orders of magnitude faster than the obvious set-based solution. I'd like to figure out what exactly...
September 3, 2011 at 2:28 pm
I haven't even attempted it. To do so would be to execute 3600 select statements connected by UNION ALL. I cannot imagine that that would do anything good for performance.
September 3, 2011 at 11:16 am
Here is how the devices are distributed.
Server_Id, Device_Id
1 has 1540 Device_Id's
2 has 742 Device_Id's
3 has 357 Device_Id's
4 has 26 Device_Id's
5 has 917 Device_Id's
September 3, 2011 at 9:11 am
It had no effect sadly.
September 2, 2011 at 4:58 pm
There is a Fifth ServerId, but it only has 160,000 rows of the 18 million. There are no other server ID's.
*Edit* I Added the fifth and final ServerId to my...
September 2, 2011 at 4:23 pm
The index already exists.
Also, keep in mind that the MAX() Method is only taking 650ms, so it's not taking an excessively long time. It's just that the UNION ALL method...
September 2, 2011 at 3:53 pm
Fairly slow actually. 🙂 Average for two runs is 19906.0
I should also mention that as of this writing, this table contains over 18 million rows, and that is only expected...
September 2, 2011 at 3:11 pm
Yes and no. I believe that the book is dated a bit though. SQL Server Express 2005, the database limit was 4G. That limit was increased to 10G in SQL...
August 24, 2011 at 8:06 am
JB, I would recommend starting your own thread to ask for help, instead of posting in a 2 year old thread.
August 18, 2011 at 10:49 am
Viewing 15 posts - 16 through 30 (of 38 total)