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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Spot the incorrect syntax..! 2

Status
Not open for further replies.

chewyone

IS-IT--Management
Jul 17, 2006
19
0
0
IE
With the below code, I keep on getting the following error:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '('.

Can anyone spot the problem please..?! Thanks!

UPDATE ((APTLive.dbo.Person INNER JOIN APTLive.dbo.Employee
ON APTLive.dbo.Person.PersonUID = APTLive.dbo.Employee.PersonUID)
INNER JOIN APTLive.dbo.Employer ON APTLive.dbo.Employee.EmployerUID = APTLive.dbo.Employer.EmployerUID)
INNER JOIN APTLocal.dbo.[User] ON APTLive.dbo.Person.PersonUID = APTLocal.dbo.[User].PersonUID
SET APTLocal.dbo.[User].PersonUID = "999999"
WHERE APTLive.dbo.Employer.EmployerUID= '1252191';
 
I had it all wrong... I took it from Access to SQL so a few adjustments were needed.

This worked perfect:

UPDATE APTLocal.dbo.[User]SET PersonUID = '999999'
FROM ((APTLive.dbo.Person INNER JOIN APTLive.dbo.Employee
ON APTLive.dbo.Person.PersonUID = APTLive.dbo.Employee.PersonUID)
INNER JOIN APTLive.dbo.Employer ON APTLive.dbo.Employee.EmployerUID = APTLive.dbo.Employer.EmployerUID)
INNER JOIN APTLocal.dbo.[User] ON APTLive.dbo.Person.PersonUID = APTLocal.dbo.[User].PersonUID
WHERE APTLive.dbo.Employer.EmployerUID= '1252191';
 
spot the incorrect syntax?

well, for starters, [User] might be valid in both Access and SQL Server, but it's invalid in the language of this particular forum

;-)

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top