Syntax Error Updating SQL Server Table
The following SQL statement works great in Access, but not in SQL Server:
UPDATE inv_decrement INNER JOIN inv_test2 ON inv_decrement.itemnumber=inv_test2.itemnumber
SET inv_test2.inventoryavailable = (inv_test2.inventoryavailable-inv_decrement.inventoryavailable);
(SQL Server Error: Incorrect syntax near the keyword 'INNER' )
In both the Access and SQL Server databases, I created two identically structured
tables with a primary key on .itemnumber. When I run the above statement
in Access, the records in inv_test2 are updated properly with the corresponding
records in inv_decrement (decrements inventory counts). In SQL Server, I
get a syntax error.
Any ideas? Is UPDATE a valid SQL Server keyword?
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL