Forum Replies Created

Viewing 12 posts - 106 through 117 (of 117 total)

  • RE: Cursor with INSERT

    Pretty Neat 😎

    CREATE PROCEDURE usp_CONF_reg_historicals

    /*==============================================================================================

    IRON CHEF

    Today's secret ingredient: Cursors

    ==============================================================================================*/

    AS

    BEGIN

    DECLARE @pa_eventmeetingsetupid NVARCHAR(38)

    DECLARE @pa_eventidname NVARCHAR(55)

    DECLARE @pa_meetingstartdate DATETIME

    DECLARE @CT INT

    DECLARE @createdbyname NVARCHAR(55)

    DECLARE @registrationsetupidname NVARCHAR(55)

    DECLARE @extendedamount MONEY

    DELETE FROM ironchef_database_user.dbo.war_ConferenceRegistrations

    -- meetings

    DECLARE...

  • RE: Cursor with INSERT

    OOOOH okay. that makes perfect sense now.

    I was thinking the first one was all I needed but it makes sense now because the second FETCH is inside the BEGIN END...

  • RE: Cursor with INSERT

    Thanks guys.

    I'm just curious why another fetch is needed. I tested your suggestion and it worked.

  • RE: Cursor with INSERT

    I've read cursors are slow. It's not for a production type environment.

    I'm just trying to learn how to create cursors since I'm not familar with them.

    Honestly I'm not sure why...

  • RE: SELECT column puzzle

    I'm starting to think the solution is to somehow merge records? I'm not sure if that would be the right approach or if it even exists in t-sql

  • RE: SELECT column puzzle

    that is correct.

    I didn't know how to approach it so I created temporary tables and splitted the columns but then I didn't know how to not show the duplicate values...

  • RE: SELECT column puzzle

    Did you find enough info?

    the original data got changed over night so I had to send you the newer data that needed to be displayed differently

  • RE: SELECT column puzzle

    I forgot to mention three or more STGs for each individual.

    It's ok if John Doe in row 1 and Jane Doe in row 2 and Peter Doe in row 3...

  • RE: SELECT column puzzle

    Sorry.

    Attachments for more sample data. ignore the first sample data I sent earlier.

    Here is a pic of the output that is required:

    Thanks again so much for wanting to help 😀

  • RE: SELECT column puzzle

    Hi Lynn

    attached are the table ddl and sample inserts

    thanks

  • RE: TSQL Puzzle

    You are the man. It worked however I do need to do it dynamically because I don't know the maximum number of ballotcommitteename in advance.

    CTE is way new to me.

  • RE: TSQL Puzzle

    Thanks Guys.

    Hey Mark I changed what you told me and it worked so far. However the problem is I don't know how many time's I'll have to add the...

Viewing 12 posts - 106 through 117 (of 117 total)