开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜