Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating/Changing only PART of a Field Entry, not the whole thing

Status
Not open for further replies.

Rexolio

Technical User
Joined
Aug 29, 2001
Messages
230
I have a field in a SQL database for email addresses. I have 45,000 records. Out of those at least a few hundred or home.com email addresses. As you probably know, home.com went out of business and all home.com email addresses changed over to attbi.com. I'm wanting to do a UPDATE for just those fields that contain @home.com, and change just that part to @attbi.com. Only know how to update the entire field. Is there a way to do this. I know the replace function in Access gives you the option, but don't know about SQL.
 
Thanks cbokowski, but I can't find what I'm looking for. Thought I did but can't find the references it speaks of (i.e. Select "Find" from The Query menu, Select "Replace" from the Query menu...) I can't find either "Find" nor "Replace" form what I believe is the Query menu.

Maybe its because I'm using SQL Server 7.0 and this help/tutorial file you sent me to is for a newer version.

Either way, I need to do this soon and I need someone to assist me please!!!
 
UPDATE yourtable
SET yourfield =
REPLACE (yourfield, '@home.com', '@attbi.com')

I think you're mistaken in doing this. Not all @home.com email addresses have changed. As a matter of fact only a fairly small percentage of them have. I am on Comcast and still retain my @home address. The same is true for Cox and others. Only ATT accounts were shut off by excite because ATT had already planned to begin using their own infrastructure.
I started out with nothing, and I still have most of it.
 
Thanks jhall, on both tips!!!! I'll do some more research before making any changes!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top