Viewing 15 posts - 706 through 720 (of 3,957 total)
Late to the party but how 'bout something like this?
DECLARE @Extract VARCHAR(3) = 'No'
,@desc VARCHAR(10) = 'TEST';
SELECT a.txt
FROM #test a
JOIN #test1 b ON a.id = b.id...
March 5, 2014 at 3:08 am
The Dixie Flatline (3/4/2014)
I just read that fourth article on splitting strings based on patterns: Good stuff.
Thanks! I like to think of PatternSplitCM as sort of a...
March 4, 2014 at 9:57 pm
SQLRNNR (3/4/2014)
Sorry about that link. It was at the top (of the article) and probably could have been more visible.
Pardon my aging eyes. The link is there I...
March 4, 2014 at 8:06 pm
Actually, this might be a little more straightforward.
WITH Sales AS
(
SELECT *, category=CASE WHEN period BETWEEN 4 AND 9 THEN 'Summer' ELSE 'Winter' END
...
March 4, 2014 at 8:02 pm
Taking Jack's setup data and @d variable, I propose this.
WITH Sales AS
(
SELECT *, category=CASE WHEN period BETWEEN 4 AND 9 THEN 0 ELSE 1 END
...
March 4, 2014 at 7:24 pm
Thanks for the set up data Jason.
I believe you can also do something like this:
CREATE TABLE #sometab
(
someid INT IDENTITY(1,1)
...
March 4, 2014 at 6:41 pm
The Dixie Flatline (3/4/2014)
with tally as (select top(ISNULL(len(@pstring),0)) N from dbo.tally order by...
March 4, 2014 at 6:27 pm
ChrisM@Work (3/4/2014)
SELECT DATEDIFF(dd,0,GETDATE())-1
SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0)
SELECT DATEADD(hh,18,DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0))
Use q3. q1 and q2 help explain the algorithm.
I can do it with just two date function calls:
SELECT DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,'18:00')
I can also name that tune in 3...
March 4, 2014 at 6:17 pm
Great article Jason! An enjoyable and informative read.
One question. In the section where you're describing left-deep/right-deep, is it safe to assume you're saying that the context only applies...
March 4, 2014 at 6:01 pm
pandeharsh (3/3/2014)
Actually ,
DECLARE @T dbo.MyTable;
INSERT INTO @T (Value) VALUES(6),(4),(10),(11);
confused me.Now its clear .I thought this will directly insert into...
March 4, 2014 at 5:20 pm
Evil Kraig F (3/4/2014)
Excellent usage explanation article, thanks for that.
The issue with table parameters is the big reason you'd want to use one, cross database or cross server data...
March 4, 2014 at 5:19 pm
The Dixie Flatline (3/4/2014)
CREATE FUNCTION dbo.CleanString_bh
(@pString VARCHAR(8000),@pPattern VARCHAR(100))
RETURNS TABLE
AS
RETURN
(
with tally as (select top(len(@pstring)) N from...
March 4, 2014 at 5:08 pm
SQLRNNR (3/3/2014)
Jason is a man of few words and a code-talker to boot! 😛
March 3, 2014 at 5:26 pm
eg61088 - Good input and thanks for reading.
March 3, 2014 at 4:46 pm
pandeharsh (3/3/2014)
Thanks.Great article.so now can do DML operation inside function using TVP.
so database state can be change inside function .
I'm not sure why you're drawing this conclusion from the article...
March 3, 2014 at 4:41 pm
Viewing 15 posts - 706 through 720 (of 3,957 total)