November 27, 2017 at 8:09 am
Is there an easy way to do schema only exports in mssql
November 27, 2017 at 8:16 am
myukas - Monday, November 27, 2017 8:09 AMIs there an easy way to do schema only exports in mssql
You could extract a DAC.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 27, 2017 at 8:19 am
I know about that and it works well however I want to be able to automate this and run a schema extract like once a week
November 27, 2017 at 8:49 am
myukas - Monday, November 27, 2017 8:19 AMI know about that and it works well however I want to be able to automate this and run a schema extract like once a week
I don't see a problem with that. Use the SqlPackage command line to extract the DACPAC.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 27, 2017 at 8:59 am
not familiar with that how does it work
November 27, 2017 at 9:12 am
myukas - Monday, November 27, 2017 8:59 AMnot familiar with that how does it work
Presumably you know how to automate running of an executable?
If yes, everything else you need to know is explained in the link. Just run it, with appropriate parameters, and the DACPAC will be created.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 27, 2017 at 10:19 am
that works thanks much but what is best way to review bacpac file to see what is in it
November 27, 2017 at 10:26 am
myukas - Monday, November 27, 2017 10:19 AMthat works thanks much but what is best way to review bacpac file to see what is in it
DACPACs and BACPACs are different (BACPACs contain data). I think you mean DACPAC.
1) Try unzipping a DACPAC and viewing the files it contains, or
2) Try deploying a DACPAC to a dev SQL instance to generate an empty database with the desired structure.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 27, 2017 at 10:31 am
i did that and it works just thought there would be a cleaner way to see it like in the gui
guess if i want to automate this it will have to work
November 27, 2017 at 10:44 am
myukas - Monday, November 27, 2017 10:31 AMi did that and it works just thought there would be a cleaner way to see it like in the gui
guess if i want to automate this it will have to work
Using the DACPAC isn't a bad way to do it.
Not sure exactly of what type of scripts you were looking for but you could also use Powershell to use SMO and the scripting options. There are quite a few examples of doing this if you wanted to pursue that route.
Sue
November 27, 2017 at 10:59 am
myukas - Monday, November 27, 2017 10:31 AMi did that and it works just thought there would be a cleaner way to see it like in the gui
guess if i want to automate this it will have to work
Depends on the whole purpose of this exercise.
Are you coming at it from the wrong angle, perhaps?
We have all of our DB code captured in source control and we have a process set up to compare what's in source control with what is deployed. If any differences are found, an alert is generated.
So, at any time, we know exactly what is deployed and to which environment by looking at the relevant branch in our VCS.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 27, 2017 at 11:14 am
I am a consultant and the client does not have that. This will work for what I need. Thank you for all your help
November 27, 2017 at 11:24 am
If you want a list of tables as in the SSMS Object Explorer, then you need to apply (import) the DACPAC to a database. The SSMS OE is just reading metadata from the database. There isn't a good tool to do this from a file and display the results. If you unpack the DACPAC, you can see the .SQL file, but it's not necessarily as organized as one might like.
November 28, 2017 at 2:27 pm
right click database --> task -- Generate Scripts
choose objects --> script entier database
set scripting options --> advanced
select 'schema only' for 'types of data to script'
November 28, 2017 at 2:34 pm
goher2000 - Tuesday, November 28, 2017 2:27 PMright click database --> task -- Generate Scripts
choose objects --> script entier database
set scripting options --> advancedselect 'schema only' for 'types of data to script'
And the poster said they wanted to be able to automate it. Don't think that one can be automated which is why there are the other suggestions.
Sue
Viewing 15 posts - 1 through 15 (of 17 total)
You must be logged in to reply to this topic. Login to reply