I have to generate some random data, but from Regular Expression given.
For example I have these rules:
1) IsRegEx('^(((([0-1]?[0-9]|2[0-3])(:[0-5][0-9])?)?:)?[0-5])?[0-9]$', #COMMENT#)
2) IsRegEx('^[0-9]+:([0-5][0-9]):([0-5][0-9])$',#COMMENT#)
3) IsRegEx( '^[0-9]+$' , #COMMENT#)
and many others… I have to generate text #Comment# which will pass the rule. It is not necessary to there are many variations, one is enough.
Have anyone do something like this?
Thanks in advance.
The proper way to do this in Sql Server – thru CLR stored procedure or CLR user defined function, if your Sql Server version allows this. Else – there is no any acceptable way.