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

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 update tbl2 from values in tbl1?

Author  Topic 

asta
Starting Member

1 Post

Posted - 2003-05-09 : 06:57:38
I have 2 tables, tbl_news and tbl_artist:
tbl_artist has 2 columns tbl_artist.id and tbl_artist.name &
tbl_news has tbl_news.title and tbl_news.id

I wanna update tbl_news.id = tbl_artist.id if tbl_news.title contains any words in tbl_artist.name

I use something like this
UPDATE tbl_news SET tbl_news.ID = tbl_artist.ID FROM tbl_news, tbl_artist WHERE CONTAINS(tbl_news.title, tbl_artist.name)

but it doesnt work... I am clueless now...
thanks.


SamC
White Water Yakist

3467 Posts

Posted - 2003-05-09 : 09:34:05
You may need

SET IDENTITY_INSERT ON

Look in BOL. Can't modify an identity without special handling.

Sam

Go to Top of Page
   

- Advertisement -