Viewing 15 posts - 1,141 through 1,155 (of 1,228 total)
Paul White (2/21/2010)
February 21, 2010 at 3:55 am
shawndidy (2/21/2010)
I need to randomly select questions my database. i used the following query:
...
February 21, 2010 at 3:18 am
Rather than aggregating and analysing your data in a single step, run a full-speed preaggregate, then analyse the results. All that CASEing and SUMing one row at a time will...
February 21, 2010 at 2:45 am
Paul White (2/20/2010)
February 21, 2010 at 2:14 am
GilaMonster (2/20/2010)
ChrisM@home (2/20/2010)
Can you please confirm which version of SQL Server you are using?Chris Kitchen (2/20/2010)
I'm running SQL Server 2000 Enterprise Edition on Win2k3 Enterprise Edition
D'oh, thanks Gail.
February 20, 2010 at 12:28 pm
Chris
If this seems way too obvious then I apologise beforehand - table variables can very often be directly swapped out for derived tables which the optimiser knows and understands.
Are...
February 20, 2010 at 11:59 am
@ Matt: until I've posted evidence to support this statement, consider it retracted with humble apologies.
Here's where it started, some messing about with CROSS APPLY - note that this query...
February 20, 2010 at 11:17 am
Matt Miller (#4) (2/20/2010)
ChrisM@home (2/20/2010)
Paul White (2/20/2010)
UsingChrisM'sArun's super test-data script, the following appeals to me:snip
'Course it does, it's got a CROSS APPLY in it!:hehe:
CROSS APPLY is an awesome...
February 20, 2010 at 9:54 am
sachin1sharma (2/20/2010)
thanks for your awesome replies and suggestions but i think i myself got deviated from the original requirement. Below is what I actually need.
select * from #tmp_Dates_Notional
-- The desired...
February 20, 2010 at 7:21 am
Paul White (2/20/2010)
UsingChrisM'sArun's super test-data script, the following appeals to me:snip
'Course it does, it's got a CROSS APPLY in it!:hehe:
CROSS APPLY is an awesome operator to use for...
February 20, 2010 at 4:43 am
Hi Arun
Follow the link to Jeff Moden's article in Wayne's post above. The article explains in great detail how to perform the quirky update and also identifies those situations where...
February 20, 2010 at 4:09 am
Here's a CTE solution to this problem - just the SELECT, but easy enough to use as the input for an UPDATE FROM:
;WITH NumberedSet AS (
SELECT RowNum = ROW_NUMBER() OVER...
February 20, 2010 at 3:36 am
arun.sas (2/20/2010)
nice move with inner join.
But the situation always not with max date
UPDATE t
SET t.date2 = (SELECT MAX(date2) FROM #temp WHERE date2 <= t.date1)
from #temp t
However, you should see...
February 20, 2010 at 3:09 am
GT-897544 (2/20/2010)
ziangij (2/19/2010)
i just checked it out.. without indexes, update query takes 30 sec.
with the indexes in places, it takes 2 min !
RBarryYoung (2/17/2010)
February 20, 2010 at 2:49 am
DROP table #temp
create table #temp
(
date1 datetime null,
date2 datetime null
)
insert into #temp (date1,date2)
select '2009-01-01','2009-01-01' union all
select '2009-01-02',null union all
select '2009-01-03',null union all
select '2009-01-04',null union all
select '2009-01-05','2009-01-05' union all
select '2009-01-06',null union all
select...
February 20, 2010 at 2:35 am
Viewing 15 posts - 1,141 through 1,155 (of 1,228 total)