Forum Replies Created

Viewing 15 posts - 526 through 540 (of 1,228 total)

  • RE: Get month names ordered using recursion

    Here's one way of limiting the rowcount:

    DECLARE @pString VARCHAR(8000), @pDelimiter CHAR(1)

    SET @pString = 'one,TWO,THREE,FOUR,five,six,seven,eight,nine,ten,eleven,twelve,thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty,twenty one,twenty two,twenty three,twenty four'

    SET @pDelimiter = ','

    SELECT

    ItemNumber = CAST(0 AS BIGINT),

    Item = LEFT(@pString, CHARINDEX(@pDelimiter,@pString+@pDelimiter,0)-1)...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Creating a select query as an object. Then adding the results of this record set to the message source of an email

    Debbie Edwards (2/7/2012)


    Hi thanks for the replies.

    I was hoping to not have to create additional csv files, I was hoping to keep everything as simple as possible by having them...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Creating a select query as an object. Then adding the results of this record set to the message source of an email

    Have you tried playing with HTML body format messages? The flexibility it offers is a real eye opener:

    -- make some data to play with:

    SET NOCOUNT ON

    DROP TABLE #Table1

    CREATE TABLE #Table1...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Using split funtion for multiple values

    pwalter83 (2/6/2012)


    ChrisM@home (2/6/2012)


    pwalter83 (2/6/2012)


    Hi,

    I need to use the split function to display values separated by comma(,). However, the problem I am facing is that the values itself are separated by...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Using split funtion for multiple values

    pwalter83 (2/6/2012)


    Hi,

    I need to use the split function to display values separated by comma(,). However, the problem I am facing is that the values itself are separated by space. For...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Join performance

    This is something of a long shot based on observation. There are two key changes.

    UPDATE c SET

    MATCH_FLAGS = CASE WHEN c.MATCH_FLAGS&1 = 1 THEN 4 ELSE c.MATCH_FLAGS +...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Guidance on returning result set for previous month

    Cadavre (2/1/2012)


    WHERE date_received >= DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) - 1, 0) AND

    date_received < DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)

    Too quick for me today mate...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Guidance on returning result set for previous month

    A reasonably good way to do this is to calculate a start and end date for your range. Here's a little standard date arithmetic to give you some ideas:

    SELECT DATEADD(month,DATEDIFF(month,0,GETDATE())+1,-1)...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Need to perform a count based on dates from different tables

    Hi Michael

    Something is still bugging me about this project. Of these three tables...

    StagingViews.ClaQuestionView

    Staging.ClaCases

    AF_Fraud_Jan_24

    ...which if any are created or altered by the exercise "find individuals (NameID) where a motor claim was...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Need to perform a count based on dates from different tables

    Hi Michael

    I've got a hunch that this problem could be resolved with something simple like so:

    SELECT af.*, d.*

    FROM AF_Fraud_Jan_24 af

    INNER JOIN (

    SELECT cc.NameID, cqv.ClaCaseID, cqv.Answer, cqv.QuestionDate

    FROM StagingViews.ClaQuestionView cqv

    INNER JOIN Staging.ClaCases...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Restart Counting with Row_Number()

    SQLRNNR (1/26/2012)


    ChrisM@home (1/26/2012)


    SQLRNNR (1/26/2012)


    ChrisM@home (1/26/2012)


    SQL Kiwi (1/26/2012)


    ...Using an rCTE for this sort of sequencing problem isn't as new as that other thread we participated on recently, and the logic (to...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Restart Counting with Row_Number()

    SQLRNNR (1/26/2012)


    ChrisM@home (1/26/2012)


    SQL Kiwi (1/26/2012)


    ...Using an rCTE for this sort of sequencing problem isn't as new as that other thread we participated on recently, and the logic (to me anyway)...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Restart Counting with Row_Number()

    SQL Kiwi (1/26/2012)


    ...Using an rCTE for this sort of sequencing problem isn't as new as that other thread we participated on recently, and the logic (to me anyway) is a...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Nasty Deadlock Issues

    Artoo22 (1/26/2012)


    fahey.jonathan (1/25/2012)


    For anyone else trying to read the SQL plan files, when I downloaded them, they showed up with an "xml" extension so I had to rename them with...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

  • RE: Restart Counting with Row_Number()

    SQL Kiwi (1/26/2012)


    ChrisM@home (1/26/2012)


    Heh Paul that's too funny!

    I thought the same thing! We must have been working on the opposite solutions at the same time. I must confess...


    [font="Arial"]Low-hanging fruit picker and defender of the moggies[/font]

    For better assistance in answering your questions, please read this[/url].


    Understanding and using APPLY, (I)[/url] and (II)[/url] Paul White[/url]

    Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]

Viewing 15 posts - 526 through 540 (of 1,228 total)