开发者

Autonumber field in SQL Database CE

Is there anything like Autonumber field in SQL server CE database file, li开发者_运维技巧ke we have in Access? I want to get it incremented automatically. Thanks Furqan


Have a look at

IDENTITY Property (SQL Server Compact Edition)


Use IDENTITY:

CREATE TABLE myTable(
   ID INT IDENTITY NOT NULL PRIMARY KEY, 
   Name VARCHAR(40) NOT NULL

)


CREATE TABLE Tool(
   ID INT IDENTITY NOT NULL PRIMARY KEY,
   Name VARCHAR(40) NOT NULL
)


Use IDENTITY :

CREATE TABLE t_test(
 id INTEGER IDENTITY
      PRIMARY KEY,
 name VARCHAR(10)
 );
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜