开发者

How do I insert a row in T-SQL where there are only auto-generated columns?

I have a table like this:

CREATE TABLE [dbo].[TRACEABLE](
        [TRACEABLE_ID] [uniqueidentifier] NOT NULL 
              CONSTRAINT [DF_TRACEABLE_TRACEABLE_ID]  DEFAULT (newsequentialid()),
 CONSTRAINT [PK_TRACEABLE] PRIMARY KEY CLUSTERED 
(
    [TRACEABLE_ID] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

How do I insert a row into this table? This doesn't work:

INSERT INTO TRACEABLE() VALUES开发者_如何学JAVA()

It errors on the VALUES() clause (Incorrect syntax near ')'). Taking out the brackets doesn't work either.


INSERT INTO TRACEABLE DEFAULT VALUES;

or

INSERT INTO TRACEABLE VALUES (DEFAULT);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜