Forum Replies Created

Viewing 15 posts - 3,436 through 3,450 (of 15,381 total)

  • RE: Lowest Child in recusive query

    edberg16 (1/13/2015)


    Thanks Mark Cowne.

    When I try to run the query, its giving following error:

    A non-recursive WITH clause or view should not reference itself within its own definition.

    This works fine...

  • RE: Lowest Child in recusive query

    Hi and welcome to SSC!!!

    You will need a recursive cte for this type of thing. If you can change your table to use the HierarchyID the output would be simple.

    If...

  • RE: Identity Data Types

    Good question. I knew the answer and managed to select the wrong answer...no more QOTD before the first cup of coffee. 😉

  • RE: How to check effect of insert statement during debugging of stored procedure

    SAMDEV (1/12/2015)


    Actually i have hard-coded value for @Rec but it gets calculated for each record being inserted from source table into destination.

    For this purpose I cannot directly insert values from...

  • RE: How to check effect of insert statement during debugging of stored procedure

    Why not just remove the cursor? From what you posted there is no need for a cursor here at all. This insert process should be set based instead of row...

  • RE: Are the posted questions getting worse?

    SQLRNNR (1/6/2015)


    Koen Verbeeck (1/6/2015)


    Ed Wagner (1/6/2015)


    Jeff Moden (1/6/2015)


    GilaMonster (1/5/2015)


    Jeff Moden (1/4/2015)


    I've taken to quoting the original post in many cases simply because too many people delete the original post even...

  • RE: Linked lists

    An interesting solution. The only issue I have is that the seems to be like premature optimization. We have created a very non-standard approach for a performance issue that doesn't...

  • RE: Are the posted questions getting worse?

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


    Merry Christmas and Happy Holidays, everyone.

    I'll be gone after tomorrow, heading away for a week. Everyone behave.

    Have a great holiday Steve. We are heading...

  • RE: Calculating Last 5 Business Days and Next 5Days

    MMartin1 (12/18/2014)


    jshuter (12/17/2014)


    I understand the need to use SQL when doing SQL but a little looping wont kill ya 🙂

    I'd still do something like the following

    declare @i int...

  • RE: Question about recruiters

    Rod at work (5/2/2014)


    Some offer contract to hire positions, but given my family situation I really need full-time, permanent. I need benefits from day 1 or at the very least...

  • RE: Bit Casting

    Good question. Let's not forget that this is NOT a real representation of a boolean. A bit in sql server can have 3 values with NULL being the third.

  • RE: Query table

    sharonsql2013 (12/17/2014)


    How do you query the below table so that you get the data from the latest Surveydate to 30days from then.

    Say here from 2014/11/19 through 2014/10/19

    Create Table #Temp

    (Name Varchar(255)...

  • RE: Split row into 2

    npatel 17252 (12/17/2014)


    So I would like to split rows in my query based on if they match criteria and I really havent dealt with splitting in SQL only combining(which is...

  • RE: Calculating Last 5 Business Days and Next 5Days

    jshuter (12/17/2014)


    I understand the need to use SQL when doing SQL but a little looping wont kill ya 🙂

    I'd still do something like the following

    declare @i int =...

  • RE: One Database vs. Multiple Databases

    There really isn't a right or wrong answer for this. Management is more difficult with multiple databases but there are certainly some advantages. With a single database you have to...

Viewing 15 posts - 3,436 through 3,450 (of 15,381 total)