Viewing 15 posts - 4,801 through 4,815 (of 5,393 total)
Bob Hovious 24601 (9/28/2009)
-- Gianluca Sartori
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...
-- Gianluca Sartori
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...
-- Gianluca Sartori
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...
-- Gianluca Sartori
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...
-- Gianluca Sartori
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) >=...
-- Gianluca Sartori
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...
-- Gianluca Sartori
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....
-- Gianluca Sartori
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...
-- Gianluca Sartori
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....
-- Gianluca Sartori
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...
-- Gianluca Sartori
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?
-- Gianluca Sartori
September 23, 2009 at 7:38 am
Jeff Moden always says it best!:-)
-- Gianluca Sartori
September 23, 2009 at 2:17 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...
-- Gianluca Sartori
September 23, 2009 at 1:56 am
I don't know which indexes get scanned. I suggest you read Gail Shaw's article on how to post performance problems:
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Anyway I guess you get the scans from the OR...
-- Gianluca Sartori
September 23, 2009 at 1:41 am
Viewing 15 posts - 4,801 through 4,815 (of 5,393 total)