Forum Replies Created

Viewing 15 posts - 9,931 through 9,945 (of 10,144 total)

  • RE: Updating Excel - Syntax error in UPDATE Statement

    You're welcome, Jim. Interesting that it worked for a named range but not for a worksheet (tab). I've only used this with worksheets.

    Here's a sproc which you can tailor...

  • RE: Updating Excel - Syntax error in UPDATE Statement

    Hi Jim

    It's likely that your problem is down to column data types - either the column you're updating or the column you're using as row identifier in Excel isn't being...

  • RE: Dynamic Variables in Dynamic SQL?

    You could avoid the use of those pesky variables altogether if you want...

    DECLARE @script nvarchar(max)

    SET...

  • RE: JOIN issue

    Frank

    SELECT batchid, description, merchantno, settlementdate, amount

    INTO #batch_detail

    In this table you have multiple rows...

  • RE: UPDATING using a WHILE LOOP?

    I'd really appreciate that, thanks Debbie.

  • RE: I got burned today at a SQL Server Interview!

    TheSQLGuru (3/7/2008)


    I guess someone has to play devil's advocate here, so here goes:

    Brandie, you are totally off the mark. Do whatever you can to make the most money so...

  • RE: UPDATING using a WHILE LOOP?

    It's looking good! And thanks for the feedback 🙂

  • RE: I got burned today at a SQL Server Interview!

    Brandie Tarvin (3/7/2008)


    Lynn Pettis said:

    I just wish the computer would do want I want, not what I tell it to do. It would be sooo much easier.

    Amen to...

  • RE: UPDATING using a WHILE LOOP?

    Yep. It's called an UPDATE ... FROM and will look something like this when you've finished...

    UPDATE b SET b.start_date = a.start_date, b.end_date = a.end_date

    FROM dbo.ECAF a

    INNER JOIN dbo.ECAF_IDEAR b

    ON...

  • RE: UPDATING using a WHILE LOOP?

    Absolutely Debbie! So we build the UPDATE in two steps; the first step, which is a simple SELECT, is easy to test - you have output rows to look at...

  • RE: UPDATING using a WHILE LOOP?

    I'm guessing it will look something like this...

    SELECT a.PersonID, a.start_date, a.end_date

    FROM dbo.ECAF a

    INNER JOIN dbo.ECAF_IDEAR b

    ON b.PersonID = a.PersonID AND a.start_date IS NULL AND b.end_date IS NULL

    WHERE a.start_date IS...

  • RE: UPDATING using a WHILE LOOP?

    Good, that makes things quite a bit simpler. Now, can you write a SELECT query from your source table which contains the rows and columns which you are using to...

  • RE: UPDATING using a WHILE LOOP?

    Hi Debbie

    Your first step for this UPDATE should be a SELECT which returns the rows containing the data which you want to use as your reference, i.e. which will overwrite...

  • RE: I got burned today at a SQL Server Interview!

    Jeff Moden (3/6/2008)


    Why is there always enough time to do it again but never enough time to do it right the first time? 😛

    TSQL or your cooking? 😀

    No matter...

  • RE: enhancing sql command

    Bob Fazio (3/5/2008)


    The more I look at this, there is almost nothing that you are going to be able to do to help this query. The only suggestion I...

Viewing 15 posts - 9,931 through 9,945 (of 10,144 total)