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)
 Adding Charaters to a field Name

Author  Topic 

vwilsonjr
Starting Member

45 Posts

Posted - 2003-05-20 : 20:16:44
I want to update the lastname to zz-lastname when employment_end is not null.
I have tried
Update user
set lastname = 'zz-'lastname. But as you know it doesnt work. What should the context be.

Thanks

Thank God for Forums.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-05-20 : 20:35:21
This should work:

UPDATE user
SET lastname = 'zz-' + lastname
WHERE employment_end IS NOT NULL

Tara

Edited by - tduggan on 05/20/2003 20:37:21
Go to Top of Page

vwilsonjr
Starting Member

45 Posts

Posted - 2003-05-21 : 13:03:07
Thanks I was hitting the wrong db.

Thank God for Forums.
Go to Top of Page
   

- Advertisement -