[dba-SQLServer]Update sproc

Mike and Doris Manning mikedorism at ntelos.net
Tue Feb 11 11:13:01 CST 2003


You are changing values of fields in "tblCharges" but in your update
statement you say you are updating "tblCheckRequest".  Change it to "UPDATE
tblCharges INNER JOIN tblCheckRequest...." and it should work.
 
Doris Manning
Database Administrator
Hargrove Inc.
www.hargroveinc.com

-----Original Message-----
From: dba-sqlserver-admin at databaseadvisors.com
[mailto:dba-sqlserver-admin at databaseadvisors.com] On Behalf Of Mark Boyd
Sent: Tuesday, February 11, 2003 11:43 AM
To: SQLServerList
Subject: [dba-SQLServer]Update sproc



I am trying to create a sproc in SQL2K that will update records.

I have the following code:

 

UPDATE tblCheckRequest 

INNER JOIN tblCharges ON (tblCheckRequest.ClaimNo = tblCharges.ClaimNo) AND
(tblCheckRequest.EndServDate = tblCharges.EndServDate) AND
(tblCheckRequest.CPT = tblCharges.CPT) AND (tblCheckRequest.DupCode =
tblCharges.DupCode) AND (tblCheckRequest.ProvNo = tblCharges.ProvNo) AND
(tblCheckRequest.PatientNo = tblCharges.PatientNo) 

SET tblCharges.PaidCode = 'CP', tblCharges.PaidDate = Int(Now());

 

When running this code, I receive the following message:

"Incorrect syntax near the keyword 'INNER'".

Should I not be using 'INNER JOIN ..'?

Very confused.

 

Any help is greatly appreciated.

Thanks,

Mark Boyd

Sr. Systems Analyst

McBee Associates, Inc.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/dba-sqlserver/attachments/20030211/5bb73bd0/attachment.html>


More information about the dba-SQLServer mailing list