开发者

Error in concatenation expression

开发者 https://www.devze.com 2023-03-03 08:57 出处:网络
Just a beginner, but can\'t figure out the reason for my error.Trying to create the \'email\' field with the following query:

Just a beginner, but can't figure out the reason for my error. Trying to create the 'email' field with the following query:

SET Students.Email = FirstName + "." + LastName + "@mycollege.edu"

but get the following error:

Msg 102, Lev开发者_StackOverflowel 15, State 1, Line 1 Incorrect syntax near '.'.


Like this:

UPDATE Students SET Email = FirstName + '.' + LastName + '@mycollege.edu'

But I'd suggest you read up on SQL Server and how to use SQL - this is an extremely basic question and I'm sure Google or Bing have some answers for you.


I believe you want to UPDATE the table:

UPDATE Students
SET Email = FirstName + "." + LastName + "@mycollege.edu"
0

精彩评论

暂无评论...
验证码 换一张
取 消