Forum Replies Created

Viewing 15 posts - 1 through 15 (of 1,085 total)

  • RE: Passing a #TempTable and running an ALTER ADD on it

    I was hoping to bring this up again.

    A friend looked into this and suggested doing the ALTER within the Report SP. Problem with that is, we a...

  • RE: Passing a #TempTable and running an ALTER ADD on it

    DavidB (2/27/2009)


    Ok. I will have to play more later. They both ran ok for me so I left it at that. Wasn't looking for results.

    Thanks!

    Have a great weekend!...

  • RE: Passing a #TempTable and running an ALTER ADD on it

    DavidB (2/27/2009)


    Your create procedure script will work fine with the #rpt2 table but you need to take the last column out of the create statement as that is the column...

  • RE: Passing a #TempTable and running an ALTER ADD on it

    Jeffrey Williams (2/27/2009)


    I think I understand what you are trying to do, but I am not sure it is needed. Can you just create a new formatter procedure with...

  • RE: Passing a #TempTable and running an ALTER ADD on it

    DavidB (2/27/2009)


    Try changing the procedure to the following;

    IF EXISTS( SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[Report_Processing]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)

    DROP PROCEDURE [dbo].[Report_Processing]

    GO

    SET QUOTED_IDENTIFIER OFF...

  • RE: Passing a #TempTable and running an ALTER ADD on it

    DavidB (2/27/2009)


    Unless I am mistaken, you can't "alter" a table variable but you can the #temp tables. So, if that is what you are trying to do it will not...

  • RE: Passing a #TempTable and running an ALTER ADD on it

    DavidB (2/27/2009)


    It looks like your procedure Report_Processing is trying to alter a #rpt table but you are creating a table variable @rpt. Am I missing something or could that be...

  • RE: Cursors Be Gone!

    Matt Whitfield (1/7/2009)


    You on 2000 by any chance? That's why I posted a different version to achieve the same thing - because OVER clauses are 2005+.

    That's correct. I will...

  • RE: Cursors Be Gone!

    RBarryYoung (1/5/2009)


    Farrell Keough (1/5/2009)


    We have one last cursor used for an unusual "counting" routine we must follow. I attempted to replace it with this method, but it is slower...

  • RE: Cursors Be Gone!

    Thank you TheSQLGuru. That explanation makes perfect sense. I was very stuck on why we saw such improvement, yet others were not.

    I had not realized the...

  • RE: Cursors Be Gone!

    TheSQLGuru (1/5/2009)


    There is definitely one situation where table vars help - high-volumn sproc calls where recompiles kill performance. Those are pretty rare situations but they do exist.

    I am really...

  • RE: Cursors Be Gone!

    TheSQLGuru (1/5/2009)


    1)I see people do this regulary just out of habit and NOT use the ID column or use it in such a way that indexing isn't useful. They...

  • RE: Cursors Be Gone!

    That is correct. The ID may be split and require the other fields to be truly unique.

    This dataset "may" not have that. I was just going...

  • RE: Cursors Be Gone!

    Hmmm..., I will need multiple keys for the Update. Can the @TableVariable be made with more than just the Primary Index? i.e., Cluster multiple key Index?

  • RE: Cursors Be Gone!

    Matt Whitfield (1/5/2009)


    I thought that until Jeff Moden set me straight. You can declare a table variable like this

    declare @myTable TABLE (ID INT IDENTITY (1, 1) PRIMARY KEY CLUSTERED, SomeValue...

Viewing 15 posts - 1 through 15 (of 1,085 total)