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
 SQL Server Development (2000)
 How to replace a portion of text in MS sql Column

Author  Topic 

azshah
Starting Member

3 Posts

Posted - 2005-04-14 : 11:03:21
Hi,
I am having problem in replacing portion of text in column. e.g. my column have 3000 records and the first part of all the records is constant e.g. ABCDSomeText (ABCD is constant) what I want to do is to change ABCD to AZZZ in all 3000 records the result will be some thing like ABCDSomeText to AZZZSomeText.

one more question ...How can I copy and past a colum in MS sql I was trying to copy a column from a csv file to paste it in ms sql but could not do it.
Thank you in advance.

tuenty
Constraint Violating Yak Guru

278 Posts

Posted - 2005-04-14 : 11:24:17
there is a function call replace but I'm not sure if it works when datatype is text

instead of copy + paste try the import/export wizard, the bulk insert or the bcp utilities

.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.
A candle loses nothing by lighting another candle
Go to Top of Page

azshah
Starting Member

3 Posts

Posted - 2005-04-14 : 11:27:27
thans for the reply

data type is varchar
Go to Top of Page

azshah
Starting Member

3 Posts

Posted - 2005-04-14 : 12:43:24
Thanks to all I have found the solution if some one is interested at
http://vyaskn.tripod.com/sql_server_search_and_replace.htm

it will replace all the occurances in the entire database.

Go to Top of Page
   

- Advertisement -