Visual Studio 2010 Ultimate - Data Generation Plan Setting Incorrect Data Type for Column

て烟熏妆下的殇ゞ 提交于 2019-12-08 03:52:45

问题


I have been looking into how to generate test data in our database so that we can test CRUD operations without running into foreign key constraint issues on insert.

The approach I decided to take was through Visual Studio 2010 Ultimate's Data Generator feature. Setting up the Data Generator plan for our specific database wasn't too difficult, but I am being held up by a data type issue.

Specifically, one of the columns in the database is set to be of type Bit; however, the data generator plan is setting the data type to int. From here, the only generator options I can select are Data bound generator, Integer, Sequential data bound generator, SmallInt and TinyInt.

All options except those with Int in their name don't produce an output value when running the generator. Running the generator with one of the Int generators to try and generate a value results in this error:

Error 1 TSD50003: The generator Int is not valid for column [dbo].[Contract_Relationship].[status] - type bit

This error is obvious given that the column is actually a bit instead of an Int. What isn't so obvious is how I can go about changing the data type on the column to be the correct one.

I have tried looking at the data type generator definitions under the Tools > Options > Database > Default Generators and Bit falls under the Default Data Generator Category which is tied to the Boolean type under the SQL Data Type Category.

From here I am also unable to change the generators as the dropdowns for the Default Data Generator category are tied to each SQL Data Type. Trying to change the data type of the Bit column in the Data Generator plan also doesn't work as it is read only.

Finally, I would set the column to null as a work around but it is set to be not null. Does anyone have any suggestions on how to change the data type of the column to be Bit?

Thank you in advance!

Update: I noticed after poking around a bit more in the Dev team's schema files that the column is actually set to an Int data type in there Create Table .sql files. It would seem to me that the information the Data Generator is using for the schema comes from these files.

It seems odd that the column is incorrect between the create table files and the actual database in the SQL Server client, but it is probably something not related to my question directly.

I would still be interested if anyone knew how to change the data type in the data generator, or even where the data generator is pulling the schema information from.

Thank you all again for your time.

来源:https://stackoverflow.com/questions/10218072/visual-studio-2010-ultimate-data-generation-plan-setting-incorrect-data-type-f

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!