Create auto increment primary key on SQL Server Compact Database

Just examine this script:


CREATE TABLE user (
user_id INT IDENTITY(1, 1) NOT NULL PRIMARY KEY,
user_name NVARCHAR(50)
)


Regarding IDENTITY(1, 1) and SQLCE Data Type, refer to the following article:

http://www.codeproject.com/KB/mobile/DBApplicationsForPocketPC.aspx
and
http://msdn.microsoft.com/en-us/library/aa237850%28SQL.80%29.aspx
Create auto increment primary key on SQL Server Compact Database Create auto increment primary key on SQL Server Compact Database Reviewed by czetsuya on Tuesday, September 15, 2009 Rating: 5

No comments:

Powered by Blogger.