Viewing 15 posts - 346 through 360 (of 458 total)
Well, there's a number of things I'd do differently...
On the INSERT statements, you're not inserting string values so you don't need to encapsulate them in single-quotes.
When you declare @sql, why...
August 26, 2006 at 11:52 am
Maintenance plans are somewhat flaky in my best experience.
http://www.sqlservercentral.com/columnists/aingold/workingaround2005maintenanceplans.asp
August 15, 2006 at 1:34 pm
If you want compatibility you might also look at querying INFORMATION_SCHEMA.tables. That's the same between 2000/2005.
August 15, 2006 at 11:23 am
Look into DATEADD(). To subtract 30 days from @date you'd use:
DATEADD(d, -30, @date)
August 14, 2006 at 1:50 pm
There's a couple of different ways to do it, but I'd recommend using CASE statements, honestly.
SELECT column1, column2,
CASE
WHEN @date_part = 'd' THEN DATEADD(d, @some_val, column3)
WHEN @date_part = 'm' THEN DATEADD(m,...
August 11, 2006 at 1:50 pm
I find multiple nested subqueries tends to kill performance very quickly. Oftentimes you can rewrite them with clever joins. Though Sameer is correct, covering your queries with indexes...
August 11, 2006 at 1:39 pm
UPDATE table
SET column = REPLACE(REPLACE(column, CHAR(10), '|'), CHAR(13), '|')
The CHAR() function can find line feeds and carriage returns.
August 10, 2006 at 4:41 pm
You might want to run profiler on the database server overnight and then search for BACKUP DATABASE or BACKUP LOG statements... That should give you some more information.
August 9, 2006 at 12:33 pm
I'd agree, probably best to avoid cursors. (Most) anytime you can offload iterative processing from the database into true recursive techniques using a different tool you're going to be...
August 8, 2006 at 4:49 pm
SELECT SUM(CONVERT(double, RiderCount)) / count(*) as RiderAvg
August 8, 2006 at 4:43 pm
http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part2/c0361.mspx?mfr=true
Under SQL Server 2000 Standard Edition: 2gb of RAM max.
August 8, 2006 at 9:56 am
We use VMware around here for a great deal of things. I would not recommend it for production database servers. For development and test it's fine, but we've...
August 8, 2006 at 9:37 am
Sorry, there should be a space in CROSS JOIN:
SELECT ct.*, ct2.*
FROM Cash_Table ct
CROSS JOIN (SELECT MAX(Cash_WTD) AS Max_Cash_WTD, MIN(Cash_WTD) as Min_Cash_WTD, MAX(Cash_PTD) AS Max_Cash_PTD, MIN(Cash_PTD) AS Min_Cash_PTD, MAX(Cash_Daily) AS Max_Cash_Daily,...
August 8, 2006 at 9:34 am
Use a cross join and a derived table:
SELECT ct.*, ct2.*
FROMCash_Table ct
CROSSJOIN(SELECT MAX(Cash_WTD) AS Max_Cash_WTD, MIN(Cash_WTD) as Min_Cash_WTD, MAX(Cash_PTD) AS Max_Cash_PTD, MIN(Cash_PTD) AS Min_Cash_PTD, MAX(Cash_Daily) AS Max_Cash_Daily, MIN(Cash_Daily) AS Min_Cash_Daily FROM...
August 8, 2006 at 9:33 am
Viewing 15 posts - 346 through 360 (of 458 total)