How to get /include:StaticData functionality with /Filter?

rb13crb13c Posts: 7
edited April 11, 2014 2:43AM in SQL Compare Previous Versions
Using the command line I have been able to successfully use /include:StaticData.

However, I would like to use the StaticData comparison when using /Filter instead; not to mention the documentation recommends to use filters instead. However, according to the documentation, you can not use /Include and /Filter together. How do I specify in a filter to include static data? There is no option in the Sql Compare GUI for this when setting up filters. Is there a way to include staticdata by modifying the .scpf file directly?

Comments

  • James BJames B Posts: 1,124 Silver 4
    The staticdata switch in Compare is specifically aimed at deploying data that's been specifically source controlled, so it's assumed that the data to use there is an "all or nothing" operation.

    If you need more granular control over data deployments, you'd need to look at using SQL Data Compare instead which gives you a lot more control over the data operations.
    Systems Software Engineer

    Redgate Software

  • Thanks for the insight. So there is no way to deploy static data through the SQL Compare GUI then?

    Also, I think it would be useful to change this from an all or nothing use. For example I have database that is source controlled in which we created filters by schema. This allows us to differentiate between tables that get replicated in (which we ignore for deployments) and actual tables that we modify and own. It is in these tables only we own that we'd like to source control with static data.
  • James BJames B Posts: 1,124 Silver 4
    Yeah, I don't think the GUI will touch data at all (that's what Data Compare is for :))
    The staticdata feature on the compare command line was added so you can simply deploy source controlled data without having to call another process, but it's a somewhat "simple" feature.

    You might want to suggest better control over data over on the Compare Uservoice page so we can see how popular it is?
    Systems Software Engineer

    Redgate Software

  • Thanks, I'll add something to the feature request page. My intentions aside, I'm still unclear how the /include:StaticData actually works. Is it dependent on other /include switches?

    For example for me "/include:StaticData" scripts up static data as well as other table schema change.
    If I run "/include:StaticData /exclude:Table" or "/include:StaticData /exclude:Role" nothing is scripted.
    If I run "/include:StaticData /exclude:View" the data gets scripted as well as just about everything other than views.

    Is there anyway to ONLY script out the static data (and maybe table schema since I could understand the dependency) in a comparison?
  • James BJames B Posts: 1,124 Silver 4
    I'm not entirely sure how it works under the hood- you could try using /include:StaticData and also /include:Table <tables> to see if that works - the help states that you shouldn't use exclude and include together (which sort of makes sense as if there's a "conflict of interests" which would win?)
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.