What's wrong with this stored procedure

  • Thread starter Thread starter Jeff via AccessMonster.com
  • Start date 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]
 
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]
 
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.
 
Back
Top