Searching a Visit Table Using Visual Studio Scripts dbproj - Best Practices?

I am using a database project to create all the tables needed for my .NET MVC application. I am wondering if there is a common β€œbest practice” for populating my lookup tables? I am new to .NET database projects and I don't know where to place the script for this, or should I use a script. (I think I should.)

+4
source share
2 answers

You can use the Post-Deployment script to perform such actions. You can still keep separate scripts for the actions required for each table and "include" them in the Post-Deployment script.

This combined script will be added to the deployment script for each deployment.

:r .\Populate-Table1.sql :r .\Populate-Table2.sql 
+3
source

I do not know any best practices as such, but I keep separate scripts for each table that I need to fill with data. So I will have a folder called "InitialData" and a bunch of files under "Table1.sql", "Table2.sql", etc.

+1
source

All Articles