How to create unique identity columns?

  • Thread starter Thread starter Thorsten Tarrach
  • Start date Start date
T

Thorsten Tarrach

Hallo,
With IDENTITY(1,1) I can create an AutoIncrement Column.
I however need a column with a uniqueidentifier that is created whenever a
new datarow is created.
This is possible with access, but how can I create such a column via SQL?
Thorsten
 
Hi Thorsten,

Are you talking about columns on server?
Sql server has IDENTITY keyword.
 
No, I'm using Access.

Miha Markic said:
Hi Thorsten,

Are you talking about columns on server?
Sql server has IDENTITY keyword.

True, but identity works only with int values. There is no way to create
GUIDs.
 
Hi Thorsten,

Yes, seems that it is missing or at least well hidden.
As a workaround you might create GUIDs in code or use ADOX to create such a
column.
 
Back
Top