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 statement

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2004-01-14 : 12:51:17
update
set right(au_id) = 8
from authors
where rught(au_id) = 1

What am i doing wrong?




tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-14 : 12:54:36
First of all, RIGHT requires two parameters. Secondly, your update should look more like this

UPDATE authors
SET
WHERE

Show us some sample data and what you are trying to do and we'll fix the UPDATE statement up.

Tara
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-01-14 : 13:04:46
Is this what you want?

update authors
set au_id = CONVERT(VARCHAR(50), LEFT(au_id, LEN(au_id) - 1)) + CONVERT(VARCHAR(50), 8)
where right(au_id, 1) = 1

au_id is an INT column. Is that really what your column is going to be?

Tara
Go to Top of Page
   

- Advertisement -