Updating the Visual Studio Data Creation Plan Schema
I am new to data generation plans in Visual Studio but did a little googling and cannot find an answer to this question. I made changes to my schema on the database side (changed the size of the NVARCHAR field) based on the data that was generated by the Data Generation Plan (the procedure was broken because the field was too big) and now I want to generate new data based on the new scheme.
Is there a way to re-import the schema from the database, or maintain it and connect all the time?
I know I can just resize the field inside the generation plan, but this is a simple example of something that will get tricky later.
source to share
Does the IDE integrate to update your data generation plan if your schema changes anyway?
When you create a data generation plan in a database project, the plan is based on the database schema for the project. If you create data and then the database project schema changes, you were prompted to update the plan. This behavior occurs in the following cases:
- You are creating a plan for creating data in a database project that does not yet have a schema. Then you import the schema into your database project.
- You create a data generation plan in a database project that has schemas and then changes the schema.
In both cases, you are prompted to update the data generation plan when you open it or when it becomes the active document. If you do not update the data generation plan based on the schema change, you cannot continue to edit the plan. You can close and resume the data creation plan until you display the prompt again.
More information from a blog post on this topic:
... the schema of the objects within the database must match the table within the database project.
I think you could insert a * .dgen file and do a pre-build step (or something similar) that would ensure that it always matches your DB schema. Perhaps this would automate everything.
source to share