What's wrong with this stored procedure

  • Thread starter Jeff via AccessMonster.com
  • Start date
J

Jeff via AccessMonster.com

I get an incorrect syntax error at 'INNER'

CREATE PROCEDURE [SP_UpdateTable] AS
UPDATE TableName INNER JOIN TableName_Audit
ON TableName.[ID] = TableName_Audit.[ID]
SET TableName.[User] = [Allegatiions_Audit].[User],TableName.[Date] =
[Allegatiions_Audit].[Date]
 
J

Jeff via AccessMonster.com

Sorry, I typed it incorrectly. Should be:

CREATE PROCEDURE SPUpdateTable AS
UPDATE TableName INNER JOIN TableNameAudit
ON TableName.[ID] = TableNameAudit.[ID]
SET TableName.[User] = TableNameAudit.[User],TableName.[Date] =
TableNameAudit.[Date]
 
K

Kevin3NF

Try this:

CREATE PROCEDURE SPUpdateTable
AS
UPDATE TableName
SET TableName.[User] = TableNameAudit.[User],
TableName.[Date] = TableNameAudit.[Date]
FROM TableName
INNER JOIN TableNameAudit
ON TableName.[ID] = TableNameAudit.[ID]
--
Kevin Hill
President
3NF Consulting

www.3nf-inc.com/NewsGroups.htm
www.DallasDBAs.com/forum - new DB forum for Dallas/Ft. Worth area DBAs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top