May 10, 2004 at 10:42 am
I would like to do a mass update using SQL Analyzer. I want to update the e-mail field with fname.lname@domain.com.
I have two fields fname and lname. I would like to use these 2 fields and add them to @domain.com which will be placed in the email field. How would I do this?
update tablename
set email = ?????
I can't quite figure out how to write out the update statement.
Thanks in advance!
May 10, 2004 at 11:18 am
you just concatenate the fields with the hardcoded stuff;
update tablename
set email = fname + '.'+ lname + '@domain.com'
here's a substring example in case you wanted first initial + lastname:
update tablename
set email = substring(fname,1,1) + lname + '@domain.com'
Lowell
May 10, 2004 at 12:58 pm
Thanks! I was putting quotes in the wrong places. I appreciate it! Mondays are just not my best days
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply