Viewing 15 posts - 10,396 through 10,410 (of 15,374 total)
cooljagadeesh (10/11/2012)
select dtStartDate,dtRunDate from #TestDatescross apply (select top 1 * from #EnrollmentDates
where dtRunDate<=#TestDates.dtStartDate order by dtRunDate desc ) b
This looks strikingly similar to the one I posted...
October 11, 2012 at 12:03 pm
Boris Pazin (10/11/2012)
Sean Lange (10/11/2012)
I seem to have steered you off topic.
No, I really appreciate because you spent your time to think about my problem. Thank you.
Sean Lange (10/11/2012)
October 11, 2012 at 10:33 am
Boris Pazin (10/11/2012)
Sean Lange (10/11/2012)
In your case you are processing 200 rows and it takes 2 hours. That screams of a serious need of performance tuning. I bet you can...
October 11, 2012 at 10:04 am
Boris Pazin (10/11/2012)
Sean Lange (10/11/2012)
Boris Pazin (10/11/2012)
Sean Lange (10/11/2012)
October 11, 2012 at 9:42 am
You should check out RedGate's SQL Search. It is a free plugin for SSMS and it is very solid tool for this type of thing. http://www.red-gate.com/products/sql-development/sql-search/%5B/url%5D
October 11, 2012 at 8:58 am
Boris Pazin (10/11/2012)
Sean Lange (10/11/2012)
October 11, 2012 at 8:56 am
ChrisM@home (10/11/2012)
Why don't you use UPDATE instead of inserting one row and deleting one row?
Because now we get increased index fragmentation, page splits and a slower process?
October 11, 2012 at 8:49 am
How is the performance from the select? It seems like you can't have that many rows. I am assuming the SegmentNo is a unique value? With a small int you...
October 11, 2012 at 8:45 am
If the job is taking 2 hours maybe you need to look at making the job run faster? That seems like a long time for a job to me.
October 11, 2012 at 8:39 am
Lokesh Vij (10/10/2012)
SELECT dtStartDate,
(SELECT Max(dtRunDate)
...
October 11, 2012 at 7:41 am
You are quite welcome. Thanks for letting me know that worked for you.
October 10, 2012 at 3:16 pm
As Michael said you need the TOP when using a derived table and an ORDER BY.
What I don't understand is why there is a need to have an order by...
October 10, 2012 at 2:09 pm
yogi123 (10/10/2012)
Sean Lange (10/10/2012)
However, it seems you want the most recent date...
October 10, 2012 at 2:03 pm
This looks a lot like homework. We don't typically provide answers for homework because we want you to learn.
However, it seems you want the most recent date prior to the...
October 10, 2012 at 1:52 pm
Here is an example of one way of deleting duplicates. There are plenty of other ways to do this.
create table #Dupes
(
IdentityValue int identity not null,
UserValue varchar(20),
AnotherValue varchar(10)
)
insert #Dupes
select 'asdf', 'Another'...
October 10, 2012 at 1:45 pm
Viewing 15 posts - 10,396 through 10,410 (of 15,374 total)