Forum Replies Created

Viewing 15 posts - 571 through 585 (of 3,957 total)

  • RE: Splitting one row into multiple

    Easy enough using Jeff Moden's famous DelimitedSplit8K function:

    WITH SampleData (s) AS

    (

    SELECT '2;Andy;Andy''s way 2;24;Glue;3;35;39;Oyster;2;9'

    UNION ALL SELECT '3;Tom;Tom''s way 3;39;Oyster;2;9'

    ),

    ...

  • RE: enumerating gaps between islands, ideas?

    Not exactly a traditional gaps and islands problem but fun nevertheless. Here's a relatively simple alternative.

    DECLARE @system_log TABLE(

    PK_ID int PRIMARY KEY

    ,Sequence_ID int null

    )

    INSERT @system_log(

    PK_ID

    ,Sequence_ID

    )VALUES

    (1035590, 35587),

    (1035589, NULL),

    (1035586, NULL),

    (1035585, NULL),

    (1035584, NULL),

    (1035583,...

  • RE: Matching the value after using STUFF

    Eirikur Eiriksson (8/24/2014)


    dwain.c (8/24/2014)


    Maybe I'm missing something here but I think there's no reason to construct a delimited list at all.

    SELECT a.CVID, a.JobNoticeID, IsMatch=CASE WHEN b.JobNoticeID IS NOT NULL THEN...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (8/24/2014)


    dwain.c (8/24/2014)


    I just posted a couple of solutions in the SQL 2008 thread. First in a long while unfortunately. I found I've missed it greatly.

    But for...

  • RE: Determine which pattern comes first in a string<!-- 864 --><!-- 864 -->

    To get around the performance hit on the VARCHAR(MAX), you may be able to create a MAX version of the splitter you end up using and process your data something...

  • RE: Determine which pattern comes first in a string<!-- 864 --><!-- 864 -->

    I confess to a bit of lack of understanding here (meaning in what you expect your output to be), but since you mentioned PatternSplitLoop (presumably the one from my article)...

  • RE: Are the posted questions getting worse?

    I just posted a couple of solutions in the SQL 2008 thread. First in a long while unfortunately. I found I've missed it greatly.

    But for some reason I'm...

  • RE: Rolling Max Value

    I looked at your link and I would caution you to be careful when you try to translate procedural solutions like that "ascending minima" thingy into a set-based (declarative) one....

  • RE: Need help on pattern matching

    Change the OR to AND if that is your criteria:

    SELECT *, IsMatch=CASE WHEN PATINDEX('%drawing%', scopeOfWork) > 0 OR PATINDEX('%drawing%', scopeOfWork) > 0 THEN 1 ELSE 0 END

    FROM [dbo].[u_Employment]

  • RE: Matching the value after using STUFF

    Maybe I'm missing something here but I think there's no reason to construct a delimited list at all.

    SELECT a.CVID, a.JobNoticeID, IsMatch=CASE WHEN b.JobNoticeID IS NOT NULL THEN 1 ELSE 0...

  • RE: Rolling Max Value

    Stick with a quirky update:

    use master

    go

    set nocount on

    go

    /**********************

    ** BUILD SAMPLE DATA **

    **********************/

    if object_id('tempdb.dbo.#dat') is not null drop table #dat

    create table #dat

    (

    RID int identity(1,1) primary key clustered,

    ...

  • RE: Are the posted questions getting worse?

    Steve Jones - SSC Editor (8/12/2014)


    Koen Verbeeck (8/11/2014)


    GilaMonster (8/11/2014)


    LutzM (8/10/2014)


    b) block that spammer (mominbd) and all its variations using a filter

    Maybe a throttle on posting new threads. A human can't...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (7/30/2014)


    DECLARE @Value1 INT,

    @Value2, VARCHAR[20]; -- Just for demo purposes

    DECLARE YourCursor INSENSITIVE CURSOR FOR

    SELECT

    ...

  • RE: Exploring Recursive CTEs by Example

    xsevensinzx (7/29/2014)


    Aye, I also noticed it was a bit old, but still relevant.

    I use recursive CTE's in market attribution quite a bit with user events (logs).

    Attribution is the process...

  • RE: Are the posted questions getting worse?

    Greg Edwards-268690 (7/29/2014)


    Winter and Road Construction.

    In Minnesota, there is a pothole season too.

    Plenty of time here too, although I'd venture to say someone taking in the whole Thread might take...

Viewing 15 posts - 571 through 585 (of 3,957 total)