Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 6th, 2004, 02:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: South Bend, Indiana, USA.
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default UPDATE syntax

I have this Access update query

UPDATE [T_Parameter]
INNER JOIN [T_SetupSheetParametersDetail]
     ON [T_Parameter].ParameterID = [T_SetupSheetParametersDetail].ParameterID SET [T_SetupSheetParametersDetail].ListOrder = [T_Parameter].[ListORder]

That I am trying to make work on MS SQL 2000, but I get an error: Incorrect syntax near the keyword 'INNER'.

I have tried to re-write it several different ways, and still can't get it to work.
__________________
Mitch
Reply With Quote
  #2 (permalink)  
Old February 6th, 2004, 04:21 PM
Authorized User
 
Join Date: Jun 2003
Location: Rochester, NY, USA.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Move your 'SET' statement just above your 'inner join'.
You also need a 'FROM' for inner join to work.

So, it should look like this:

UPDATE [T_Parameter]
SET [T_SetupSheetParametersDetail].ListOrder = [T_Parameter].[ListORder]

FROM [T_Parameter]
INNER JOIN [T_SetupSheetParametersDetail]
     ON [T_Parameter].ParameterID = [T_SetupSheetParametersDetail].ParameterID
Reply With Quote
  #3 (permalink)  
Old February 6th, 2004, 05:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: South Bend, Indiana, USA.
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I actually needed to modify what you suggested becasue I failed to indicate which table I was updating, so it was switched in your example. The following worked:

UPDATE [T_SetupSheetParametersDetail]
SET [T_SetupSheetParametersDetail].ListOrder = [T_Parameter].[ListORder]

FROM [T_Parameter]
INNER JOIN [T_SetupSheetParametersDetail]
     ON [T_Parameter].ParameterID = [T_SetupSheetParametersDetail].ParameterID

Thanks a lot, I kept hitting my head trying to figure why the syntax was wrong.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax error on UPDATE ktmai2001 Access 6 November 24th, 2008 12:45 PM
Syntax Error in the update statement annie_t Access ASP 1 February 1st, 2005 12:48 PM
Syntax Error in Update Louisa VB.NET 2002/2003 Basics 2 March 23rd, 2004 05:27 AM
UPDATE statement returns syntax error AviatorTim Classic ASP Databases 2 January 8th, 2004 05:22 PM
update syntax error Adam H-W Classic ASP Databases 2 July 24th, 2003 07:48 AM



All times are GMT -4. The time now is 02:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.