sql server - Concatenating records (names) in a row to create an email address -


i using sql server studio management. below issue encountering.

table name: citizen

firstname       lastname        email  john             smith      jsoi@yahoo.com  andrew           evans     evanda@gmail.com 

i change email addresses both records adopt format

john.smith@ipno.gov.uk andrew.evans@ipno.gov.uk

intended:

firstname       lastname        email  john             smith      john.smith@ipno.gov.uk  andrew           evans     andrew.evans@ipno.gov.uk 

so concatenation of firstname , lastname dot in between them , addition of @ipno.gov.uk

i appreciate or guidance on this.

i assume going update whole table. try simple method,

lower()-> convert uppercase characters if lower case.

update citizens set email = lower(firstname) + '.' + lower(lastname) + '@ipno.gov.uk' 

Comments