Re: Help with Update Query
From: Chris2 (rainofsteel.NOTVALID_at_GETRIDOF.luminousrain.com)
Date: 02/14/05
- Next message: Simonglencross: "Re: re posted"
- Previous message: Chris2: "Re: Help with Append Query"
- In reply to: winsa: "Help with Update Query"
- Next in thread: winsa: "Re: Help with Update Query"
- Reply: winsa: "Re: Help with Update Query"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 14 Feb 2005 07:31:57 -0800
"winsa" <winsa@discussions.microsoft.com> wrote in message
news:D070EBF8-49CA-4DCC-9018-E57DFC90D5B4@microsoft.com...
> Hi
>
> Me again! This time need help with an Update Query. Here is my
code:
>
<snip>
>
> I'm not getting the correct values in the tbl_MSTRACC.OUTSTANDING
field.
> Can anyone see why, or maybe it's something else?
>
> Thanks.
>
winsa,
Ok, now I'm *certain* you're using MS SQL Server.
ALTER PROCEDURE dbo.sp_OUTSTANDING_UPDATE
AS
UPDATE dbo.tbl_MSTRACC
SET tbl_MSTRACC.OUTSTANDING =
tbl_OUTSTANDING.OUTSTANDING - tbl_OUTSTANDING.CURRPMNT
FROM dbo.tbl_MSTRACC
,dbo.tbl_OUTSTANDING
WHERE tbl_MSTRACC.DEBTOR_IDX = tbl_OUTSTANDING.DEBTOR_IDX
ALTER is used to change existing procedures (for corrections,
production updates). It wouldn't be something run normally (at least
I wouldn't imagine it would be). May I ask why this is ALTER
PROCEDURE?
As for the Update statement in the stored procedure, the syntax looks
ok at first glance (MS SQL Server was willing to successfully parse
the Update portion).
As for why you're not receiving correct values? It's impossible to
know without knowing what the sample data, expected results, and
actual results are.
(FYI: Many in microsoft.public.sqlserver.programming will want you to
provide the *full* DDL of the Tables, and the *full* INSERT scripts to
load the tables with sample data, in addition to all the Transact-SQL
involved.)
You can repost over to: microsoft.public.sqlserver.programming (which
would be the most appropriate on-topic course of action), or post your
DDL, INSERTS, and T-SQL here and I'll take a look at it.
Sincerely,
Chris O.
- Next message: Simonglencross: "Re: re posted"
- Previous message: Chris2: "Re: Help with Append Query"
- In reply to: winsa: "Help with Update Query"
- Next in thread: winsa: "Re: Help with Update Query"
- Reply: winsa: "Re: Help with Update Query"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|