J
John Morgan
I would appreciate advice on using a GUID instead of auto incremented
integer in a SQL server database which will be accessed through
ASP.NET using ADO.NET.
I have read somewhere that GUIDs are preferred to auto increment.
My main reason for using a GUID is that it will be easy to know the
value of the field (used as a primary key) immediately after using a
SQL INSERT statement. However there seem to be obvious disadvantages
in the size of the database field required ( 25 digits/characters for
my purpose). Also, though I am not expert in SQL Server I know there
is the ability to retrieve a new auto increment number using
@@IDENTITY which I suppose reduces my need for a GUID approach,
Best wishes, John Morgan
integer in a SQL server database which will be accessed through
ASP.NET using ADO.NET.
I have read somewhere that GUIDs are preferred to auto increment.
My main reason for using a GUID is that it will be easy to know the
value of the field (used as a primary key) immediately after using a
SQL INSERT statement. However there seem to be obvious disadvantages
in the size of the database field required ( 25 digits/characters for
my purpose). Also, though I am not expert in SQL Server I know there
is the ability to retrieve a new auto increment number using
@@IDENTITY which I suppose reduces my need for a GUID approach,
Best wishes, John Morgan