One of the very useful features in SQL Server Data Tools (SSDT) is a possibility of offline database projects. If you have an existing database in SQL Server it’s quite easy to create a database project from it.
- In Visual Studio click File -> New -> Project
- In New Project window select SQL Server template, select SQL Server Database Project and enter the desired name for you project, then press OK
- In Soltion Explorer right-click you project, select Import in context menu, then Database.
- In Import Database page press New Connection button (if you had not created any connection earlier).
- In Connection Properties page enter the Server name and select a database name in dropdown list.
- In Import Database page press Start button. Visual Studio will create the definitions of your database objects in database project.
- After all is done just press Finish button. Now let’s go to the Solution Explorer and examine the code.