Visual Studio SSDT Ignore Query Store Options in Publish Profile
There does not seem to be a way to ignore individual database properties. However, you can ignore them all by adding the following to your publish profile XML file:

&lt;ScriptDatabaseOptions&gt;False&lt;/ScriptDatabaseOptions&gt;


I have tested this and it does indeed leave out the QUERY_STORE statements.

Then, if there are any database-level properties that you do want set, you can add them back in manually via a Post Deploy SQL script that is added to the project and tagged as being PostDeploy in the file properties, under the "Build Action" property drop-down.

You can also add that XML element to your .sqlproj file or your .sqlproj.user file.

This option needs to go within a &lt;PropertyGroup&gt;, regardless of which of the three files you put it in. The order of them items within the &lt;PropertyGroup&gt;...&lt;/PropertyGroup&gt; don't matter.

Another option, if you are merely generating the "Create" or "Publish" SQL script and are not deploying it immediately, is to use a utility to find and replace the two SET QUERY_STORE... lines with something like:

SET {some other DB property} = {its current setting}; --


For example:

SET TRUSTWORTHY OFF; -- 


Which should result in those two lines being turned into:

SET TRUSTWORTHY OFF; -- (QUERY_CAPTURE_MODE = NONE, ...


You might want to look into the following dos-based RegEx processor:

JREPL.BAT - regex text processor with Unicode and XRegExp support