Solved

Can "uniqueidentifier" value be generated based on Algorithm ? - SQL Server

Posted on 2011-09-28
2
232 Views
Last Modified: 2012-08-14
Hi,

Can we create an "uniqueidentifier" value based on certain Algorithm ? I want to make sure that all the values of the "uniqueidentifier" column must satisfy one Algorithm - for data integrity. Please do NOT provide about Encryption.

Thanks
0
Comment
Question by:milani_lucie
2 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 250 total points
ID: 36719647
Create the column as type "UniqueIdentifier" and then when you add to it you can call "newid()"

newid() is a build-in SQL function that will make sure the GUID is globally unique or at least unique at the server level - depends on your setup.

If you are using a coding language, there are ways to produce GUID's there too.
0
 
LVL 6

Assisted Solution

by:judgeking
judgeking earned 250 total points
ID: 36816024
You don't need to have a column of type 'uniqueidentifier' in your DB table, you can just make it 'int' (or something else).  Then just make that column the primary key and define it as 'unique' in the table designer.  Whenever you add a row, just supply a new ID along with your other data (ensuring it's unique by whatever method you use).

Do you have the algorithm to generate your IDs, or do you need one?
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now