Last post Nov 18, 2008 06:02 PM by ksridharbabuus
Nov 18, 2008 10:56 AM|harish.msn|LINK
value against each product id in sql table . Will I always get the unique values I mean can I use this value to uniquely identify any row in my table.
Nov 18, 2008 11:41 AM|Erwin21|LINK
The System.Guid has a very low probability of being duplicated.
You can better create an id column with an identity increment and primary key.
Nov 18, 2008 11:53 AM|harish.msn|LINK
creating an id column with an identity increment and primary key is the way but sometimes like using it in QueryString is not safe and that is real concern.
In Guid case i think Using it in Query string should be safe option.
but i want zero probablility of duplication. Is it so??
still looking for more responses...................
Nov 18, 2008 12:55 PM|ksridharbabuus|LINK
There is no chance of repeating the value for GUID.
You can go ahead in uniquely identify the data. We used in most of our applications to uniquely identify the data.
In SQL Server we have a function called newid() which will generate a guid for you. When you create a table you can have a column with default value as newid().
So that whenever you insert automatically new guid will be inserted.
Nov 18, 2008 02:02 PM|harish.msn|LINK
sql newid() is more convincing.
System.Guid.NewGuid().ToString() gives us the option of changing the format of string.
So we can use
Nov 18, 2008 06:02 PM|ksridharbabuus|LINK
Yes you can go with either with NEWID() function SQL Server or GUID.NewGuid() function in .Net.