Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quick Syntax Query

Status
Not open for further replies.

PreacherUK

Technical User
Sep 26, 2002
156
NL
Hi All,

Heres a quick snatch of sql:
UPDATE [tblGSP55S9X - Security Data] INNER JOIN ASSETS_TO_ESTIMATE] ON [tblGSP55S9X - Security Data].CUSIP=[Assets_To_Estimate].CUSIP SET [Assets_To_Estimate].ISIN= [tblGSP55S9X - Security Data].ISIN

(sorry for the shabby looking formatting here)

When I attempt to run/check this I get the following error:

Incorrect syntax near the keyword 'INNER'.

The query is attempting to link two tables on one type of identifier and update one table with addictional identifiers.

Any help is greatly appreciated
 
I think it should be more like:

Note, set has been moved and the addition of the FROM part

UPDATE [tblGSP55S9X - Security Data]

SET [Assets_To_Estimate].ISIN= [tblGSP55S9X - Security Data].ISIN

FROM [tblGSP55S9X - Security Data]

INNER JOIN ASSETS_TO_ESTIMATE] ON [tblGSP55S9X - Security Data].CUSIP=[Assets_To_Estimate].CUSIP


Damian.
 
Just to offer some closure on this one, as I didnt get around to it again till this morning:

UPDATE dbo.tblAssets_To_Estimate
SET dbo.tblAssets_To_Estimate.ISIN = dbo.[tblGSP55S9X - Security Data].ISIN
FROM dbo.tblAssets_To_Estimate INNER JOIN
dbo.[tblGSP55S9X - Security Data] ON dbo.tblAssets_To_Estimate.CUSIP = dbo.[tblGSP55S9X - Security Data].CUSIP


That seems to work for me.


Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top