Question:
I have a table with the columns ID, Name, Prename, Mail
Mail contains the e-mail address of a person, for example john.doe@example.com
Now I need to check whether Name=” or Prename=”
and extract “John” from Mail and put it into Prename, and put “Doe” into column Name
Can i do that with SQL, if yes how ?
I use MS-SQL 2005
You can use an
UPDATEstatement as follows.To test this solution, try with a single string as a test.