Viewing 15 posts - 4,801 through 4,815 (of 5,394 total)
Maria, thanks for posting your code.
The cursor based solution works well and reliably, but could become too slow when the table becomes really large. Cursor based solutions don't scale well,...
September 30, 2009 at 3:40 pm
Bob Hovious 24601 (9/28/2009)
September 28, 2009 at 10:55 am
Steve, the first link seems to be broken: http://concentratedtech.com/content/index.php/2008/06/18/sql-server-2008-rc0-powershell-long/ gives a 404 page.
For what the second link is concerned, I think this comment says it all:
Tone? Sorry, Microsoft, but...
September 28, 2009 at 3:19 am
mgentry (9/25/2009)
I think your best bet is not to worry about how many rows you have and just worry about the running total.
Let me disagree with you: it's always a...
September 28, 2009 at 1:11 am
You could use the famous "quirky update" method for running totals:
DECLARE @RunningTotal INT
IF OBJECT_ID('tempdb..#t') IS NOT NULL DROP TABLE #t
CREATE TABLE #t (
Serial INT IDENTITY,
TransactionNo INT,
Amnt INT,
RunningTotal INT
)
CREATE CLUSTERED...
September 25, 2009 at 2:13 am
I would say LEFT JOIN, but it depends on the volumes and indexes of the tables you are joining.
With lookups, you issue one query for each row, with the join...
September 25, 2009 at 1:25 am
This should do the trick:
;WITH Months (firstDayOfMonth)
AS (
SELECT TOP 12
CAST(
CAST(YEAR(GETDATE()) AS char(4)) +
RIGHT('0' + CAST(ROW_NUMBER() OVER (ORDER BY object_id) AS varchar(2)),2) +
'01'
AS datetime)
FROM master.sys.all_columns
)
SELECT firstDayOfMonth
FROM Months
WHERE MONTH(firstDayOfMonth) >=...
September 24, 2009 at 7:56 am
Here it depends on how many rows you will have to perform the running count on, in a large table scenario.
If you only are interested in finding the top n...
September 24, 2009 at 5:48 am
I forgot to mention that the "quirky update" method for running totals is explained very clearly in an article by SQL Server MVP Jeff Moden, that currently is under rewrite....
September 24, 2009 at 2:16 am
There are at least two methods: triangular join and "quirky update".
I suggest you take the quirky update if the number of rows involved is big, especially if there is already...
September 24, 2009 at 2:10 am
Silverfox (9/23/2009)
Lynn Pettis (9/23/2009)
I took a look at this particular thread. I do agree with you, Silverfox, and I am usually one tht tries very hard in this regard....
September 23, 2009 at 9:39 am
Is it me, or the forums are receiving less questions than before?
I often use the "Active Threads" link, but I get much less forums a day than I was getting...
September 23, 2009 at 8:12 am
If he insists killing processes without knowing what they do, let him do it.
He already has decided to increase lock timeout and kill process, so, why bother?
September 23, 2009 at 7:38 am
It would be too long to explain in a forum question: I suggest you look for articles around.
http://www.google.com/search?q=set+based+code
Basically, the main concept here is that set based code leaves the task...
September 23, 2009 at 1:56 am
Viewing 15 posts - 4,801 through 4,815 (of 5,394 total)