Viewing 15 posts - 8,521 through 8,535 (of 10,144 total)
Thishave , after 3 characterwould indicate a VARCHAR or CHAR datatype. Check the datatypes of the columns in the tables. Try casting to INT or BIGINT the column which has...
April 9, 2009 at 7:11 am
Don't forget a tally-table version!
DECLARE @Untrimmed varchar(50), @Trimmed varchar(50)
SET @Untrimmed = 'HaveNow!/7896-7'
SET @Untrimmed = 'HaveNow'
--
SELECT @Trimmed = LEFT(@Untrimmed, (SELECT ISNULL(MIN(n.number)-1, LEN(@Untrimmed))
FROM Numbers n
WHERE n.number <= LEN(@Untrimmed)
AND NOT ascii(lower(substring(@Untrimmed, n.number,1)))...
April 9, 2009 at 6:23 am
karthur (4/9/2009)
Is there a function or functions I can use in SQL Server 2005 to give me just...
April 9, 2009 at 5:16 am
No worries Allan, though I think it's Adi who deserves the credit.
Have a read of this when you've got a few minutes.
Cheers
ChrisM
April 9, 2009 at 4:29 am
The BEGIN is in the wrong place. Here's the example from BOL:
DECLARE Employee_Cursor CURSOR FOR
SELECT EmployeeID, Title FROM AdventureWorks.HumanResources.Employee;
OPEN Employee_Cursor;
FETCH NEXT FROM Employee_Cursor;
WHILE @@FETCH_STATUS = 0
BEGIN
...
April 9, 2009 at 4:24 am
Do you mean this?
DROP TABLE #GroupMembers
CREATE TABLE #GroupMembers (
Group_member_id INT,
Member_name VARCHAR(10),
Group_name VARCHAR(3),
[Order] INT)
...
April 9, 2009 at 3:12 am
john.arnott (4/8/2009)
April 9, 2009 at 2:19 am
RBarryYoung (4/8/2009)
Peso (4/8/2009)
April 8, 2009 at 3:09 pm
RBarryYoung (4/8/2009)
Yeah, my data follows the rules, but plays havoc with any simple distribution assumptions.😀
No fair :sick: it's only 25% populated with numbers! If that!
April 8, 2009 at 10:17 am
Peso (4/8/2009)
Ramesh (4/8/2009)
-- Actual Results
ID...
April 8, 2009 at 8:26 am
Peso (4/8/2009)
For Number < 40000 I get these resultsRamesh' Version : 2683 ms
Peso : 1546 ms
Here's a randomised set of 15 rows, Peso - wanna give them both a try?...
April 8, 2009 at 8:07 am
Peso (4/8/2009)
Using Ramesh's test cases, I get these timings:Ramesh' Version : 526 ms
ChrisM' Version 3 ("condensed" version 2) : 23480 ms
Peso : 236 ms
Ooookaaaaayyyy proof of the pudding...run against randomised...
April 8, 2009 at 7:53 am
36376 ms? What are you running this test on, Ramesh - a twin-floppy 80's luggable? 😀
876 ms is awesome:cool:
April 8, 2009 at 7:24 am
Very elegant! Makes my CASEy stuff look like a dustbin full of spaghetti!
Who's gonna test with 40,000 rows then? 😀
April 8, 2009 at 6:24 am
Viewing 15 posts - 8,521 through 8,535 (of 10,144 total)