Forum Replies Created

Viewing 15 posts - 2,401 through 2,415 (of 3,957 total)

  • RE: Need some function help, debuggin, destupifying....

    GilaMonster (12/11/2012)


    CptCrusty1 (12/11/2012)


    Gail, I once asked you why you're called Gila Monster.

    Old story.

    Gail

    Gila

    Notice the letter ordering. Now add a friend with a mild typing problem (typed faster with her...

  • RE: Need help on an if statement

    How about something like this?

    ;WITH Dates AS (

    SELECT MyDate='2012-11-01'

    UNION ALL SELECT '2012-04-04')

    SELECT MyDate

    ,CASE WHEN DATEPART(month, MyDate) <= 7...

  • RE: Query for a plus sign

    Another way using Lynn's test table:

    SELECT * FROM #TestTable WHERE CHARINDEX('+', TestStr) > 0

  • RE: Simular to PIVOT Table, but not

    Happy to help out!

    SELECT UserID

    ,[White Blood Cell Count]=MAX(CASE LabName WHEN 'White Blood Cell Count' THEN ResultValue END)

    ,[Red Blood Cell Count]=MAX(CASE LabName WHEN...

  • RE: Departures from Origins and Arrivals at Destinations

    Between submission of this article and publication, the POC for PNG has been tweaked a little and while doing so I noticed a couple of issues so I will publish...

  • RE: Delete records in group - but not all

    CELKO (12/8/2012)


    A lot of critics, but thanks for that! Will try to use your suggestions in my following posts.

    Getting toasted by me is a ritual of passage in...

  • RE: Splitting Strings Based on Patterns

    dwain.c (11/29/2012)


    dplaut 49149 (11/29/2012)


    Is there a way to download these examples, copying text out of those scrolling boxes is a pain and carries along formatting code.

    Sorry but in this article...

  • RE: Update Gaps

    Jeff Moden (12/6/2012)


    oralinque (12/6/2012)


    dwain.c & Jeff Moden, your solutions worked great! Thank you both so much!

    Jeff - "Data smears" sounds good to me. Regarding the "clear requirements and readily...

  • RE: Update Gaps

    You're welcome!

    I note that I neglected to mention mine only works because you happened to already have the clustered index needed to order the QU.

  • RE: Multivalue Parameters with Stored Procedure

    We are in the SQL 2008 forum right?

    You can try something like the following. It may not be perfect (can't test because I don't have the underlying View_UK_TicketsDetails table)...

  • RE: Update Gaps

    Jeff Moden (12/6/2012)


    I don't believe the following won't be quite as fast as a Quirky Update...

    Easy for you to say...

  • RE: String to Rows question (quasi xml??)

    Perhaps you're looking for something like this.

    CREATE TABLE #Test( string TEXT)

    INSERT INTO #Test

    VALUES('<ITEM>ABC</ITEM><ITEM>DEF</ITEM><ITEM>GHI</ITEM>')

    SELECT Item=item.value('.', 'VARCHAR(10)')

    FROM #Test

    CROSS APPLY (SELECT CAST(string AS XML)) a(string1)

    CROSS APPLY string1.nodes('ITEM') b(item)

    DROP TABLE #Test

  • RE: Update Gaps

    You can try a quirky update (QU).

    DECLARE @MachineID INT = 0

    ,@Pressure FLOAT = 0

    UPDATE u WITH(TABLOCKX)

    SET Pressure = CASE WHEN Pressure = 0

    ...

  • RE: Splitting Strings Based on Patterns

    Shalinder - Thanks for dropping by and having a read.

    Chris - Thanks for the cover. Back now from PNG so I hope to catch up on some earlier promises...

  • RE: Query Help

    UnionAll (11/30/2012)


    Thanks All.

    Dwain - Query works for me, but i don't think i understand what you mean by resolving multiple levels of hierarchy - my ignorance. I always have a...

Viewing 15 posts - 2,401 through 2,415 (of 3,957 total)