Getting a substring of value in another column
lukemmiller
Posts: 4 New member
I am trying to generate a username based on the the first initial of their First Name and their last name. I see how to get their last name $[LastName]. How do I extract the first initial of their first name?
Comments
Thanks for your post. There isnt a way to do this out of the box in SQL Data Generator. You could try writing a Regular Expression using the RegEx generator to try and accomplish this, or create a file containg first letters, and use this file as a generator in conjunction with the RegularExpression. The Last name and first name generators are using files that get installed with SQL Data Generator (first.txt and last.txt). Hope this helps.
Best Regards,
Steve Tanori
Product Support
Red Gate Software Ltd.
866-997-0378
replace username with left(firstname,1)+lastname