Skip to content
Discussion options

You must be logged in to vote

hi! In good news - this is possible.
The functionality you're looking to do (take a database schema out into files) is the SqlPackage extract command with the /p:ExtractTarget property set to ObjectType, Schema, or SchemaObjectType.

sqlpackage.exe /Action:Extract /TargetFile:{filename}.sql /DiagnosticsFile:{logFile}.log /SourceServerName:{serverFQDN} /SourceDatabaseName:{databaseName} /SourceUser:{username} /SourcePassword:{password} /p:ExtractTarget:File

From the extract docs:

Specifies alternative output formats of the database schema, default is 'DacPac' to output a .dacpac single file. Additional options output one or more .sql files organized by either 'SchemaObjectType' (files in …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@chadbaldwin
Comment options

@chadbaldwin
Comment options

@dzsquared
Comment options

@chadbaldwin
Comment options

Answer selected by chadbaldwin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants