Data Generation for nvarchar & varchar.
When using the data generator, the the data generation preview tool
window within Visual studio shows gibberish text for a varchar or a nvarchar column, the generator being set to string. Is there a setting that i'm missing ?
I have not made any specific setting - just added a data generation plan to the project. Is there some property that needs to be
set at this stage?
The collation is Latin1_General_CI_AS
-Tanveer Rashid
Hi Tanveer, can you please explain me what gibberish characters you are seeing? If I think what you think, there's nothing gibberish in those chars
.
In fact the Latin1 collation allows all those characters, and the fact that the Data Generation generates also those characters instead of a simple a-z/A-Z, automatically provides you more test coverage for free.
Aldo
Hi Tanveer,
Aldo is right. The generated values are valid for that collation. Although this data is useful for testing purposes, it probably does not look like your production data. If you would like to have more control over the generated values, you might try the regular expression generator. The default expression ([a-zA-Z0-9]*) produces strings containing English alphabet characters and digits 0-9. You can enter your own regular expression as well. You can find more information about regular expressions at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconRegularExpressionsLanguageElements.asp
Thanks!
-Jon
Right now on UnicodeString generator, you can select different locales from the dropdown list for Locale in Properties Window to generate strings that correspond to the locale selection. For example, if you choose Locale for Chinese, you will get Chinese strings generated.
Thanks,
Henry Zhang, SDE, Visual Studio Team System - Database Professionals