Forum Replies Created

Viewing 15 posts - 2,671 through 2,685 (of 5,504 total)

  • RE: How to add two #Temptables

    How about

    SELECT your_statement1

    UNION ALL

    SELECT your_statement2

    ?

    Side note: you don't really need to store it in two temp tables before the UNION operation (as long as you don't need those separate...

  • RE: Are the posted questions getting worse?

    ALZDBA (10/22/2010)


    Jeff Moden (10/21/2010)


    ALZDBA (10/20/2010)


    Dito.

    And it only serves a single purpose. i.e. strict hierarchy.

    Ever tried building a family tree ?

    Thanks for the input, Johan. Heh... from what I've seen,...

  • RE: Sequence-numbering groups

    gmrose (10/21/2010)


    Thank you again to Lutz and Wayne. I updated my script per Lutz' suggestions to use table #tmpChecks instead of table variable @tmpChecks. I made some minor...

  • RE: Sequence-numbering groups

    That explains the bad performance pretty much...

    You're using a table variable just like I did for my demo version. :blush: My fault. I'm sorry.

    A table variable is a bad option...

  • RE: Sequence-numbering groups

    gmrose (10/20/2010)


    After I finish reading the article, I will need to build a new statement using its suggestions. The one that I built based on Lutz's solution has been...

  • RE: Sequence-numbering groups

    Craig Farrell (10/20/2010)


    Lutz, that is wild. I like it. Thanks. :w00t:

    Have you done that on huge recordsets? Does it perform well?

    No, I haven't. And I probably won't either.

    Such...

  • RE: Debugging Stored Procedure with looping cursor

    You might want to compare the performance of your loop with the following code.

    I can't tell you if it'll return the same results since I have nothing to test against,...

  • RE: Sequence-numbering groups

    It's slightly more complicated than just using a CTE...

    DECLARE @tbl TABLE

    (

    ckid INT,stat VARCHAR(10)

    )

    INSERT INTO @tbl

    SELECT 101 ,'Open' UNION ALL

    SELECT 102 ,'Open' UNION ALL

    SELECT 103 ,'Open' UNION...

  • RE: Delimited String in one Column

    Which one did you try? T-SQL or CLR?

  • RE: Averaging based on a condition TSQL

    Something along those lines?

    SELECT

    id,

    CASE

    WHEN EXISTS (SELECT 1 FROM #TblTemp t2 WHERE t1.id=t2.id AND Price=9999.9999)

    THEN 1111.1111

    ELSE AVG(Price) END AVGPrice

    FROM #TblTemp t1

    GROUP BY Id

  • RE: Delimited String in one Column

    Did you search this site for "DelimitedString8K" on this site?

    This is a function posted by Jeff Moden. If you get the "right thread" (don't recall the link right now) you'll...

  • RE: Are the posted questions getting worse?

    GilaMonster (10/20/2010)


    For the second one, check out the thread over at SQLTeam with the same question.

    I followed the link you posted and it seems like the OP is not erally...

  • RE: Are the posted questions getting worse?

    Is it just because I'm in a bad mood today or why do I have the feeling that todays questions are more demanding with even less effort than on other...

  • RE: What is Best Way to calculate presence time....

    Uripedes Pants (10/20/2010)


    I think he probably gave up because you still haven't filled the request for easily consumable create table statements and test data. When I looked at the...

  • RE: How to find no of employees whose startTime differs by 0hrs,with 2hrs.

    SeanLange (10/20/2010)


    LOL Lutz. 😀

    What's so funny about it? I found it rather sad... :crying:

Viewing 15 posts - 2,671 through 2,685 (of 5,504 total)