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)
 Pl. help!

Author  Topic 

pranesh
Starting Member

2 Posts

Posted - 2005-08-16 : 17:24:08
Hi,

I need to update all "data" in an existing column with "Prefix+data".

How can I do that?

Any help is much appreciated.

Thank you.

Peter
Alberta, Canada

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-08-16 : 17:25:32
update <yourtable>
set <yourColummn> = <prefix> + <data>
where <yourColummn> = <data>

Corey

Co-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now."
Go to Top of Page

pranesh
Starting Member

2 Posts

Posted - 2005-08-16 : 17:50:47
Thank you so much,Seventhnight for your lightening prompt response. It worked perfectly.

best regards,
Pranesh

Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2005-08-16 : 19:02:25
just a note, before you do updates like that you should make sure you have a backup.

sometimes I just create a copy of the table just to be safe. something like this works:


select *
into tablename_cya
from tablename




-ec
Go to Top of Page
   

- Advertisement -