Can I use WHERE clause to filter data?
PeterDaniels
Posts: 89 Bronze 3
In SQL Data Compare, I am able to set a WHERE clause on a table to filter data that I don't want in the comparison. I'd like to use this functionality in SCA to filter off local dev environment specific data from a table. I'm not seeing an option for setting that. Is it available?
Tagged:
Answers
If you are using SCA projects, then this should be doable using the option under Controlling data deployment with SQLCMD variables. See https://documentation.red-gate.com/sca3/developing-databases-using-sql-change-automation/generating-scripts-to-capture-database-changes/data-population for further information.
If you're using SOC projects though, it's not possible to do this directly: however, instead of using Static Data, you could have an additional step calling sqldatacompare.exe.
I'm using SCA. I've read the SCA docs on data. That didn't quite get me there, though. I want to use a where clause filter in the SCA project, like I can do inside SQL data compare.
I also need to filter my static data with a where statement. I need all static data in a table where a specific column is null and push them to git. Is this possible with the change automation filters?
@PeterDaniels , @matpez
Did you found any solution?