create table dbo.a(
     printfmt             AS ((convert(varchar(255),[autoval]))),
   prec                 AS ((convert(smallint,case when ((type_name([xtype]) = 'ntext' or (type_name([xtype]) = 'image' or type_name([xtype]) = 'text'))) then null when (type_name([xtype]) = 'uniqueidentifier') then [xprec] else (odbcprec([xtype],[length],[xprec])) end))),
   scale                AS ((odbcscale([xtype],[xscale]))),
其中的 as (( convert 是什么意思!

解决方案 »

  1.   

    to LouisXIV(夜游神) 是sqlserver 2000
    to pbsql(风云)  是计算列的表达式,能解释一下是什么意思吗?
      

  2.   

    你看看这个就知道什么是计算列了create table testtable
    (
    a as 1+2,
    b as 'abc',
    c int
    )
    insert into testtable
    select 1select * from testtable
    drop table testtable
    /*a           b    c           
    ----------- ---- ----------- 
    3           abc  1
    */
      

  3.   

    printfmt             AS ((convert(varchar(255),[autoval]))),
    其中的 as (( convert 是什么意思!
    ---------------------------------把字段autoval的内容转换成类型varchar(255)来表达,新的名称是 printfmt convert类型专号函数,cast也是类型转换函数。
      

  4.   

    创建表时, 用 列名 as ... 的方式创建的都是计算列.as 后面的表达式是该列的每条记录的值(不能修改, 表达式自动算出列值), 而表达式的计算结果类型也确定了列的数据类型.