altering a table column
create table Names (
FirstName varchar(40),
LastName varchar(40),
FullName AS FirstName+开发者_StackOverflowLastName
)
but now, in the full name i want that a space is inserted between first and last name, so i am altering the table but it gives syntax error. how to alter it.
alter table Names
alter column fullname as FirstName+' '+LastName
You can do this instead:
alter table Names drop column fullname
alter table Names add fullname as FirstName+' '+LastName
You can not ALTER computed columns. You can drop and recreate
精彩评论