December 18, 2008 at 5:23 am
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';
December 18, 2008 at 5:28 am
Your syntax is completely incorrect.
Update TargetTable
SET TargetColumn = SourceColumn
FROM TargetTable INNER JOIN ....
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 18, 2008 at 5:30 am
Well not really, it would almost be correct in Access which is probably where that all started.
The deletes and updates (especially in joins) are quite differente betwen Access and SQL Server.
December 18, 2008 at 5:35 am
Yep, it came from Access! THanks a million, I'm in a mad rush..
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';
December 18, 2008 at 5:51 am
Ninja's_RGR'us (12/18/2008)
Well not really, it would almost be correct in Access which is probably where that all started.
I haven't worked in Access for so long I can't remember anything about it's syntax.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 18, 2008 at 6:24 am
And there I was thnking you knew everything about everything ;). Now that dream is gone for me.
December 18, 2008 at 6:45 am
Ninja's_RGR'us (12/18/2008)
And there I was thnking you knew everything about everything ;). Now that dream is gone for me.
There I was thinking you dreamed about SQL Server, and all the time you were dreaming about Gail:D
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
December 18, 2008 at 6:56 am
I think I can safely assume that I have no possible good answer to that post so I'll just shut up :w00t::hehe:.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply