Forum Replies Created

Viewing 15 posts - 46,156 through 46,170 (of 59,062 total)

  • RE: Cursors for T-SQL Beginners

    sudhanvag (1/2/2009)


    Extending the table structure given in the articlehttp://www.sqlservercentral.com/articles/cursors/65136/%5D

    I have added an extra table for UserListing.

    CREATE TABLE dbo.tblUser ( codUser INT, codName VARCHAR(20),PRIMARY KEY (codUser));

    insert into dbo.tblUser values (1, 'abc');

    insert...

  • RE: Cursors for T-SQL Beginners

    slippers (1/1/2009)


    Hi

    One question: if considering whether to use Cursors or alternatives, how does trigger firing influence the decision?

    I mean, when using a cursor to perform an insert statement with...

  • RE: Cursors for T-SQL Beginners

    battelofhalfwits (1/1/2009)


    Wow...

    Two things

    1) Never use Cursors! Looping through a temp table takes less overhead than a Cursor; especially when you are working on a 24/7/365 server where you really...

  • RE: Cursors for T-SQL Beginners

    JRoughgarden (1/1/2009)


    OK, I'll take up the case for using cursors for some types of processing. I've posted below a copy of a stored procedure I just finished. It uses a...

  • RE: Cursors Be Gone!

    Ok... from JacRobert's description, Create Table statement, and a couple of good guesses like the fact that since all the columns are nullable, there's no primary key, here's a chunk...

  • RE: Cursors Be Gone!

    Heh... an I'll maintain that what he said is nutty for mor than 1 reason. Consider the title and the first sentence...

    [font="Arial Black"]Let's deprecate UPDATE FROM! [/font]

    I guess that...

  • RE: Cursors Be Gone!

    Cool... that 1899-12-30 thingy about the time also explains why you add 2 days to the combination of date and time. Thanks, Jac.

  • RE: Cursors Be Gone!

    And, just to be 100% clear... would you give a couple of actual examples of the various cookie formats you're expecting so I can make a good cross section of...

  • RE: Cursors Be Gone!

    Matt Whitfield (1/2/2009)


    Jeff Moden (1/2/2009)


    jacroberts (1/2/2009)


    TheSQLGuru (1/2/2009)


    jacroberts, I am pretty sure (>90%) that your problem can be solved with a self-join set-based solution. If the table is properly indexed...

  • RE: Cursors Be Gone!

    Phil Factor (1/2/2009)


    Jeff

    I'll take that challenge and I'll take all comers.

    [p]I've got a 'quirky' Update solution that motors. I'd love some real data to run comparative timings on.[/p]

    Heh... not fair,...

  • RE: Cursors Be Gone!

    TheSQLGuru (1/2/2009)


    Jeff Moden (1/2/2009)


    Alexander Kuznetsov (12/24/2008)


    Actually in most cases the best alternative is a loop written in a modern language such as C#, not a T-SQL WHILE loop or a...

  • RE: Cursors Be Gone!

    jacroberts (1/2/2009)


    TheSQLGuru (1/2/2009)


    jacroberts, I am pretty sure (>90%) that your problem can be solved with a self-join set-based solution. If the table is properly indexed that solution could well...

  • RE: Cursors Be Gone!

    Matt Whitfield (1/2/2009)


    Hmmm. Just wrote a massive reply and the session timed out!!

    Oh well. The long and short of it was:

    1) It's pretty trendy to bash microsoft, but I'm going...

  • RE: Cursors Be Gone!

    Lawrence (1/1/2009)


    Jeff, I've been following this post as I am a SQL Noob and walked into a position where cursors are everywhere and I'm trying to understand when/when not to...

  • RE: Cursors Be Gone!

    Tom.Thomson (1/2/2009)


    I think you are being a bit unfair to him,Jeff.

    Heh... Yet, you just agreed with everything I said about UPDATE. 😉 The real fact of the matter is...

Viewing 15 posts - 46,156 through 46,170 (of 59,062 total)