When I work offline with Visual Studio 2012 Database Project my best option for generating deployment scripts is to provide dacpac files so visual studio can perform schema comparison and generate scripts.
Below is example how to extract dacpac from a database so I can use the output file with my database project.
NOTE: You can do that from SSMS but it doesn't always work (for instance it didn't work for me with Master Data Services (MDS 2012) database that was auto generated for me by SQL Server 2012) but it worked with sqlpackage.exe
and below is sample code:
"C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe" /action:Extract /tf:"C:\FolderName\FileName.dacpac" /SourceConnectionString:"Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=SSPI;Persist Security Info=False;"
Remember to change:
- sqlpackage.exe location (e.g. Program Files (x86) to Program Files)
- dacpac target path