Viewing 15 posts - 556 through 570 (of 2,007 total)
dwain.c (8/8/2012)
The performance test result is interesting.
Try mine with:
OPTION (MAXDOP 2)
And watch the CPU...
August 8, 2012 at 5:35 am
Performance test as promised: -
SET NOCOUNT ON;
SELECT TOP 1000000 Student_ID,
Sex = CASE WHEN sex = 1 THEN 'M' ELSE 'F' END,
RaceCode = CASE race WHEN 0 THEN 'Other' WHEN...
August 8, 2012 at 5:07 am
dwain.c (8/8/2012)
;WITH Unpivoted AS (
SELECT SchoolCode, RaceCode, Code, Value
...
August 8, 2012 at 4:39 am
Quick performance test: -
SET NOCOUNT ON;
IF object_id('tempdb..#sampleData') IS NOT NULL
BEGIN
DROP TABLE #sampleData;
END;
--1,000,000 Random rows of data
SELECT TOP 1000000 IDENTITY(INT,1,1) AS [Sno],
CAST((ABS(CHECKSUM(NEWID())) % 20000)...
August 6, 2012 at 8:13 am
My version: -
--Create sample data
SELECT [Sno], [Column]
INTO #sampleData
FROM (SELECT [Sno] = 1, [Column] = '01112300'
UNION ALL SELECT 2, '00100'
...
August 6, 2012 at 8:04 am
SomewhereSomehow (8/6/2012)
Thx for the testing scripts! Especially pointing a bug with replace function (closed as by design).
I have quite similar results
========== SomewhereSomehow ===========================================
SQL Server Execution Times:
CPU...
August 6, 2012 at 4:53 am
Mark-101232 (8/6/2012)
Million row test for three of the solutions. Results are interesting/surpising. Perhaps some of you folks could check this and run it.
Celko forgot to account for the REPLACE "bug".
Change...
August 6, 2012 at 3:41 am
franck.maton (8/6/2012)
SELECT count(1)
...
August 6, 2012 at 3:28 am
franck.maton (8/6/2012)
You are guessing well, the first query doesn't work, the second either by the way :/
The third one tells me that approximatively all my records...
August 6, 2012 at 1:42 am
I'm guessing that when you run this: -
SELECT CONVERT(datetime,CounterDateTime)
FROM [MSSQL_PerfmonCollector].[dbo].[CounterData];
You have the same error?
If so, you have some bad data in there, which is why you should always be using...
August 6, 2012 at 1:27 am
shahsn11 (8/3/2012)
Since i am a newbie , i am having some problem while...
August 3, 2012 at 7:49 am
shahsn11 (8/3/2012)
Hi,How will i reverse the number in SQL Server with out using reverse()
Is this an intellectual challenge? Because otherwise, use reverse().
I guess you could do something like this...
August 3, 2012 at 5:24 am
Very cool. Will have to dig into this and see whether or not it's something that is viable for use in my environment.
August 2, 2012 at 7:33 am
laurie-789651 (8/1/2012)
IF OBJECT_ID('dbo.Sales1') IS NOT NULL
DROP TABLE dbo.Sales1;
CREATE TABLE dbo.sales1
(
Sales_saleID int,
Sales_customerID int,
Sales_status varchar(10)
);
INSERT INTO dbo.sales1 VALUES ( 1, 1, 'Pending' );
INSERT INTO dbo.sales1 VALUES ( 2, 1, 'Completed'...
August 1, 2012 at 9:29 am
Learn to alias your tables.
SELECT *
FROM #temp1
WHERE test1 IN (
SELECT test1 --refers to #temp1
FROM #temp2
);
SELECT *
FROM #temp1
WHERE test1 IN (
SELECT a.test1 --refers to #temp2 and will error
FROM #temp2 a
);
What you...
August 1, 2012 at 9:22 am
Viewing 15 posts - 556 through 570 (of 2,007 total)