Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Random seeding ID's

Author  Topic 

berneslai
Starting Member

2 Posts

Posted - 2014-10-30 : 06:17:33
Hi,

I'm looking to allow access to other business users of a replicated SQL database containing anonymized customer data for research purposes. One of the specifications of the project is that account numbers (all 10-digit), along with customer details, are also anonymized.

I've been researching the use of RAND() and NEWID() to try and accomplish this but I would like a randomized account number to be calculated - so I can revert to the actual number using a seed - rather than having to constantly use a look up table.

Is this achievable?

From looking at previous posts on the Internet, plenty deal with generating a unique random number for use but not in a calculated method.

Thanks,
B.

mole999
Starting Member

49 Posts

Posted - 2014-10-30 : 10:21:47
could you not just multiply by an eight digit odd number then divide with another 8 digit even number, you would have to reverse the steps, to get back to the original account number (not sure how accurate that would be), but would be difficult to guess if supplied without the sql

Mole
Go to Top of Page

berneslai
Starting Member

2 Posts

Posted - 2014-10-30 : 11:08:27
That's my fall back plan but, if anyone gets sight of an original and calculated number together (not likely, I grant you) then they could work out the calculation required. This is why I'd like to attempt to derive a seed first.

I'm also not sure if each row would be unique if I multiplied by an odd number and then divided by even. If there are any rounding issues then there may be duplicates.
Go to Top of Page
   

- Advertisement -