Is an uniqueidentifier data type in SQL the same as an autonumber in Access?
I’m creating a database using SQL for the first time and was wondering if a uniqueidentifier data type is the same as an autonumber in MS Access? If it isn’t can anyone show me how to make SQL automatically create an integer value for a primary key?
2 Solutions collect form web for “Is an uniqueidentifier data type in SQL the same as an autonumber in Access?”
Uniqueidentifier is a 16 byte GUID. Represented as a 32 character hex string.
Int is an integer.
To create a table with an integer as a primary key in MS SQL like such:
CREATE TABLE TableName( YourIDColumn INT PRIMARY KEY IDENTITY(1,1))
I have taken the liberty in seeding your identity key starting at 1, and the auto increment by 1. Note that this is also the default in SQL but I have specified it here for clarity sake. The statement will also create a primary key (and by proxy a clustered index) on that column.
Yes it is. In Access, you have to use Autonumber or Long. Not String.
Then, in the lower pane of the design window, specify Field Size: Replication-ID
Now the field will hold a true GUID.