Viewing 15 posts - 1,366 through 1,380 (of 5,502 total)
I would test how many rows would the following join return:
Inner Join on CostPrice = CostPrice and Reference = Reference AND LastUpdatedDate <= TransactionDate.
Depending on the number of rows returned...
June 25, 2011 at 2:54 am
Oh, before I forget:
To get the result you're looking for (desc order), just add an "ORDER BY cte_tally.n DESC" to the code I posted. 😉
June 25, 2011 at 2:09 am
I have to ask again: why do you insist in using a loop?
Even if there is a set based solution available?
It seems like performance is not on your...
June 25, 2011 at 2:06 am
jkp2311 (6/24/2011)
Thanks for help me out.
But it is difficult for me using CTE.
anyway, i know we can do also another way using nested while loop.
it's much easier that...
June 24, 2011 at 4:59 pm
Steve mentioned the disconnects from any active clients when failover occurs for mirroring.
That's a major difference to a cluster configuration where the IP (or the system name) doesn't change. Since...
June 24, 2011 at 4:06 pm
If you insist in using a while loop: I don't know how to do it. 😉
But here's a set based solution:
declare @c1 int
set @c1 = 5
;
WITH cte_tally AS
(SELECT Number +1...
June 24, 2011 at 3:49 pm
Maybe this link will help you to narrow down the root cause.
As a side note: by choosing to post in a different language than English (especially in a thread header)...
June 24, 2011 at 3:29 pm
Craig Farrell (6/24/2011)
I'm not necessarily sure I'd want SET LANGUAGE to be changing my DATEFIRST once I've specifically set it anyway, so your concern is actually a benefit to me....
June 24, 2011 at 2:42 pm
You wold need to use dynamic SQL for such a requirement.
June 24, 2011 at 2:17 pm
@craig-2: I strongly vote against any method involving SET DATEFIRST and/or DATEPART(dw)
One of the (undesired?) side effects: once you have a specific SET DATEFIRST in your batch, any following SET...
June 24, 2011 at 2:07 pm
This is based on a week from Monday 12:00 AM to Sunday 11:59:59.999PM:
SELECT
FROM YourTable
WHERE YourColumn > = DATEADD(wk,DATEDIFF(wk,0, GETDATE() -1 ),0)
June 24, 2011 at 1:54 pm
First you need to define what a week is (e.g. does it start on Sunday or Monday or any other day? Is it based on ISO week (52 or 53...
June 24, 2011 at 12:42 pm
Tara-1044200 (6/24/2011)
June 24, 2011 at 12:00 pm
Why would you create a table per user?
Add a column where you store the information what Portal User (or whatever you define as a unique connection) the data belong to.
But...
June 23, 2011 at 3:46 pm
Sounds like an auditing task.
Assuming you're using SS2K5 (as indicated by the forum you posted in), you might want to consider a trigger concept using the data from the internal...
June 23, 2011 at 1:15 pm
Viewing 15 posts - 1,366 through 1,380 (of 5,502 total)