大家好~~~~
我想让某一列的默认值是该条记录的另一个字段,请问我的默认值应该怎么写??

解决方案 »

  1.   


    create table tb (
    f1 int null ,
    f2 as (f1) 
    ) on primary
    go
      

  2.   

    服务器: 消息 156,级别 15,状态 1,行 4
    在关键字 'primary' 附近有语法错误。
    有这样的错误信息
      

  3.   

    create table tb (
    f1 int null ,
    f2 as (f1) 
    ) on [primary]
    go
      

  4.   

    create table tb (
    f1 int null ,
    f2 as f1
    )
    go

    CREATE TABLE [tb] (
    [f1] [int] NULL ,
    [f2] AS ([f1]) 
    ) ON [PRIMARY]
    GO