SQL Server Database Project (hereafter referred to as: SSDP) look at the name to know that this is a data base, and the database is certainly not involved. Before reaching such projects, most of the data manipulation was done in SQL Server Management Studio (hereafter referred to as: SSMS). A series of operations related to the database can now be completed with SSDP. SSDP, what do we do with it, and why do we use it? A: In my opinion SSDP is equivalent to a database template tool, we can use it to create a database template, and then through the definition of the template we can quickly, very convenient to generate a clean and tidy database.
Give me a chestnut:
Classmate A has a database that has been put into use, and now classmate B wants a database identical to DB.
-Solution: Backup Restore
Now B students only want the structure, do not want the actual data in the table (and the database version and a classmate of the different)
-Solution: Export table structure and related scripts, go to another library to execute again (what will be the problem, haha)
Now B students ask for more. If it is a business table as long as the table structure, not data, and if it is a system configuration table, both the table structure and data
-Solution: hahaha, what do you want to do? (Maybe you can always find a way, but is it really convenient?) )
.....
Said so much, not good to know, below we start our first database project. (The environment shown in this article is: VS2013 + SQL Server 2012)
First, create the project
After the project is created such as: The project is empty at this time, because we have nothing added, in the initial state. Next we will create the corresponding directory structure.
Ii. Creating a directory structure
This directory structure is not dead, you can decide on your own (that is to say you do the whole line). But I generally use the structure of development, haha. In addition to the Deployment Events directory, the names of other directories should understand their purpose. So what's the Deployment Events catalogue for? So, when we're done with this SSDP development, we're going to deploy this project to generate the entity database. In the process of deployment, you can perform two events, one before deployment (Prev), and one after deployment (Post). This directory is used to store the relevant execution program code files.
VS in SQL Server application for Database Project (i)