不知道这样可不可以? create table tablename(a int not null,b int not null,c int not null,d as a+b+c)
sql2000中:CREATE FUNCTION plusFieldRETURNS int AS BEGIN RETURN ( @a + @b + @c ) END GOCREATE TABLE TB1 ( a int, b int, c int, d AS ( dbo.plusField(a,b,c) ) ) GO
create table tablename(a int not null,b int not null,c int not null,d as a+b+c)
AS
BEGIN
RETURN ( @a + @b + @c )
END
GOCREATE TABLE TB1
(
a int,
b int,
c int,
d AS
(
dbo.plusField(a,b,c)
)
)
GO