If you’ve ever needed to generate random data inside SQL
server then you probably know what a pain it can be, especially when you need
that data to be human readable cities, states, names, phone numbers, etc.
This CLR make the task quick, easy and performs very well!
The download contains the CLR DLL, install script, example script and also a
great deal of pre-generated word lists.
Please keep in mind that this CLR was designed for
development and test environments and is not at all intended for production use. Install steps: - On the SQL Server, unzip to C:\
- Run script: C:\CLR\DataRandomizer\Install Functions.sql
- Of course, you can change the location if you also alter the script.
- Enjoy.
Example SQL Script:
SELECT
dbo.IsInitialized() as IsInitialized,
dbo.FlipCoin() as FlipCoin
SELECT
dbo.GetRandomString(10) as GetRandomString,
dbo.GetRandomAlphaString(10) as GetRandomAlphaString,
dbo.GetRandomNumberString(10) as GetRandomNumberString
SELECT
dbo.GetRandomStringLengthBetween(5, 10) as GetRandomStringLengthBetween,
dbo.GetRandomAlphaStringLengthBetween(5, 10) as GetRandomAlphaStringLengthBetween,
dbo.GetRandomNumberStringLengthBetween(5, 10) as GetRandomNumberStringLengthBetween
SELECT
dbo.GetRandomFullAddress() as GetRandomFullAddress,
dbo.GetRandomStreetAddress() as GetRandomStreetAddress,
dbo.GetRandomPhoneNumber() as GetRandomPhoneNumber,
dbo.GetRandomNumberOfWords(2, 5) as GetRandomNumberOfWords,
dbo.GetRandomCompanyName() as GetRandomCompanyName
SELECT
dbo.GetRandomWords(3) as GetRandomWords,
dbo.GetRandomCity() as GetRandomCity,
dbo.GetRandomStreetSuffix() as GetRandomStreetSuffix,
dbo.GetRandomWord() as GetRandomWord,
dbo.GetRandomStreetName() as GetRandomStreetName
SELECT
dbo.GetRandomDomainSuffix() as GetRandomDomainSuffix,
dbo.GetRandomStateName() as GetRandomStateName,
dbo.GetRandomEmailAddress() as GetRandomEmailAddress,
dbo.GetRandomNumber(10, 20) as GetRandomNumber,
dbo.GetRandomCounty() as GetRandomCounty
Results:
|