Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 updating with a join
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

United Kingdom
21 Posts

Posted - 02/02/2007 :  06:48:22  Show Profile  Reply with Quote

I want to update a field in a table (Images) that contains a directory path to remove the first directory in that path. The problem is, I only want to update records that do not have a corresponding entry in another table (Products). I can't work out how to get the join to work. This is what I have, but it just errors:

update Images
left join Product on Product.frontcoverid =
Set Path = substring(Path, charindex('/',Path)+1, len(Path))
where Product.frontcoverid is null

I get : Incorrect syntax near the keyword 'left'.

... any ideas?


Flowing Fount of Yak Knowledge

5581 Posts

Posted - 02/02/2007 :  07:25:37  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message  Reply with Quote
update I
Set Path = substring(Path, charindex('/',Path)+1, len(Path))
From Images as I
left join Product P on P.frontcoverid =
where P.frontcoverid is null

Harsh Athalye
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000