Viewing 15 posts - 1,231 through 1,245 (of 2,462 total)
Wouldn't it be better to have at least separate stored procedure to use in all those different places but only returning columns that they actually need or maybe replace it...
-- Itzik Ben-Gan 2001
September 29, 2015 at 7:54 pm
I run into this all the time. The problem with DR specifically is it's not sexy. Execs love bragging about, "Now we can <fill in the blank> right from my...
-- Itzik Ben-Gan 2001
September 29, 2015 at 7:06 pm
... Or you can use PatternSplitCM (Duh...) also referenced in my signature....
SELECT Item
FROM #Sample S
CROSS APPLY dbo.PatternSplitCM(S.Numbers,'%[0-9]%')
WHERE Matched = 1;
-- Itzik Ben-Gan 2001
September 29, 2015 at 6:04 pm
One way to approach this involves 3 functions: one that removed duplicate characters, one that replaces characters based on a pattern and Jeff Moden's Splitter. There are links to two...
-- Itzik Ben-Gan 2001
September 29, 2015 at 5:54 pm
Kim Crosser (9/29/2015)
Alan.B (9/28/2015)
Alan - minor issue, but the first two fields (CC, NPA) are actually Int values. Making them Varchar(5) introduces some additional overhead in the function, where...
-- Itzik Ben-Gan 2001
September 29, 2015 at 2:39 pm
Ed Wagner (9/29/2015)
Alan.B (9/28/2015)
Ok, let's do an 800,000 row test.
Nice test, Alan. I kinda knew how it would turn out, but it was nice to see it done.
Alan.B (9/28/2015)
And...
-- Itzik Ben-Gan 2001
September 29, 2015 at 2:19 pm
Luis Cazares (9/24/2015)
GilaMonster (9/24/2015)
Alan.B (9/24/2015)
Just as a side note, this won't fail:
WITH X AS(
SELECT fld
FROM #t
WHERE cast(fld as int) > 0
)
SELECT fld
FROM X
WHERE ISNUMERIC(fld) =1
Since the optimiser pushes...
-- Itzik Ben-Gan 2001
September 29, 2015 at 2:15 pm
Luis Cazares (9/29/2015)
Alan.B (9/29/2015)
Interesting technique using REPLICATE, I would add that I like to use ...
-- Itzik Ben-Gan 2001
September 29, 2015 at 2:06 pm
Great article Luis! Informative, to the point. I picked up a couple things.
Interesting technique using REPLICATE, I would add that I like to use CHAR() more often...
-- Itzik Ben-Gan 2001
September 29, 2015 at 7:12 am
Above all, how long it takes for the query to complete. Reads (something you can get using extended events or SET STATISTICS IO ON). I look at the query plan...
-- Itzik Ben-Gan 2001
September 28, 2015 at 11:27 pm
I know and work with people who would be considered "true" data scientists as well as some aspiring data scientists. The consensus seems to be, based on what I've read...
-- Itzik Ben-Gan 2001
September 28, 2015 at 11:21 pm
Kim Crosser (9/28/2015)
Jeff Moden (9/28/2015)
Kim Crosser (9/28/2015)
-- Itzik Ben-Gan 2001
September 28, 2015 at 10:51 pm
Just as a side note, this won't fail:
WITH X AS
(
SELECT fld
FROM #t
WHERE cast(fld as int) > 0
)
SELECT fld
FROM X
WHERE ISNUMERIC(fld) =1
-- Itzik Ben-Gan 2001
September 24, 2015 at 11:01 am
using the same sample data from above and taking Luis' solution you can also do this:
WITH T AS
(
SELECT T.*
FROM @t T
WHERE NOT...
-- Itzik Ben-Gan 2001
September 24, 2015 at 10:32 am
This is just fine
DECLARE @t TABLE (memberID int);
DECLARE @m TABLE (memberID int);
INSERT @m VALUES (1),(2),(4);
INSERT @t VALUES (1),(2),(3),(4);
SELECT * FROM @t;
DELETE T
FROM @t T
LEFT JOIN @m M on T.memberID =...
-- Itzik Ben-Gan 2001
September 24, 2015 at 10:29 am
Viewing 15 posts - 1,231 through 1,245 (of 2,462 total)