I want to extract a database schema of a MSSQLServer database with Server Management Studio. I use the Extract command \"Extract Data-tier Application..\"
In the databas
If you cannot use Visual Studio you can use the command line SqlPackage
application to extract the schema from the database. By default, this does not verify the schema (no, I don't know why SSMS and the command line offering have different defaults!). SqlPackage.exe
can be found in C:\Program Files (x86)\Microsoft SQL Server\
.
For example, the following extracts the schema for MyDatabase
from the local SQL Server instance and outputs it to a .dacpac
file on the local filesystem:
sqlpackage /Action:Extract /SourceDatabaseName:"MyDatabase" /SourceServerName:localhost /TargetFile:"C:\SomeDirectory\MyDatabase.dacpac"
If you want to include schema verification at a later stage, you can set the flag explicitly by adding /p:VerifyExtraction=True
to the command line.
Full information on SqlPackage.exe
can be found here:
https://msdn.microsoft.com/library/hh550080.aspx