Forum Replies Created

Viewing 15 posts - 34,996 through 35,010 (of 59,099 total)

  • RE: TSQL Help

    Partial self-referencing Cross-Join disguised as an inner join with duplicate exclusion... you'll need to change the table names to your real table name.

    SELECT orig.Student_ID,

    ...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Select records form lasthour

    Craig Farrell (2/16/2011)


    and we haven't gotten to 8/2/2011 yet (I read it as 2010 for some reason) so yes, it's after an hour ago... LOL

    DD/MM/YYYY 😉 It's why even...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Every 3rd Friday of the Month

    Someone like Peter Larsson will probably come up with something simpler, but this works...

    SELECT CASE

    WHEN GETDATE() <=...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Help needed to decode comma delimited string and insert into tables

    jinghua.ji (2/17/2011)


    Hi all,

    Recently, I was working on turning structured audit string into a table

    sample string 1:

    ,2 Column_Name "Col1" "Col2" , 2 New_Column_Value "A" "B" , 2 Old_Column_Value "a" "b"

    sample...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: ##Tables in concurrent environment

    wolfkillj (2/17/2011)


    Hi Jeff,

    Thanks for the tip on the (max) vs. (8000)/(4000) nvarchar/varchar data types in these functions. When I implemented your new splitter function, I used nvarchar(4000), which covers...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Are the posted questions getting worse?

    The Dixie Flatline (2/17/2011)


    Jeff Moden (2/16/2011)


    WayneS (2/15/2011)


    Can anyone point me to a delimited split function that works on a varchar(max)? I know that Jeff's DelimitedSplit8K works on up to a...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: How to rewrite this basic query for SQL CE ?

    akhandels (1/17/2011)


    Hi,

    I have this piece of code written for SQL Server 2008. With all the limitations of SQLCE can anybody please help to rewrite this query?

    It is a...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: ##Tables in concurrent environment

    wolfkillj (2/16/2011)


    Sure. My multistatement table-valued function (below) is a WHILE loop that repeats as long as the string has any characters in it, finding the first occurrence of the delimiter,...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Shift pattern

    mea99sdp (2/16/2011)


    ALTER PROCEDURE [dbo].[usp_SEL_InputCount]

    @StartDate datetime,@EndDate datetime

    AS

    BEGIN

    SET NOCOUNT ON;

    SELECT TOP (100) PERCENT dbo.GetDay(ModuleTrx.Datestamp) AS Date, dbo.DayNight(ModuleTrx.Datestamp) AS DayNight, Modules.Type, COUNT(*) AS Count

    FROM ...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Shift pattern

    mea99sdp (2/16/2011)


    inline code? a little help please:P

    What I meant was that the code in the function is easy enough... remove the code from the function and use it directly in...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: How to summarise, listing on same line

    timotech (2/17/2011)


    Please guys, as u can see, the SchedulesSpots in my test is '6', so i would want the CapturedTime to show only 6 values, then the rest will be...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: How to summarise, listing on same line

    ColdCoffee (2/16/2011)


    Oops, Jeff had already posted the same solution 🙂 Sorry Jeff,dint see it 🙂

    No problem CC... now the OP has a couple of choices. 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Cross tab Report F

    You bet. Thank you for the reply. 🙂

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Are the posted questions getting worse?

    GSquared (2/16/2011)


    Fal (2/16/2011)


    Koen Verbeeck (2/15/2011)


    Fal (2/15/2011)


    WayneS (2/15/2011)


    Can anyone point me to a delimited split function that works on a varchar(max)? I know that Jeff's DelimitedSplit8K works on up to a...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • RE: Are the posted questions getting worse?

    Fal (2/16/2011)


    Brandie Tarvin (2/16/2011)


    ... But I'd avoid dark alleys, if I were you....

    Well, there goes the joy in life.

    But wait, you mentioned something about "tar and feathers"??

    Steve.

    Mmmmmm. Makes...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 15 posts - 34,996 through 35,010 (of 59,099 total)