Variables in Where Filters
Using SQL Data Compare I sometimes save projects with dozens of tables mapped out, and where clause filters. Using a multi-tenant database, I often find I need to limit the results to those that have a specific CompanyId or something similar, and I want to be able to run the project for different values quickly. It would be very helpful if I could define a variable in the project ...
e.g. @myCompanyId uniqueidentifier = '00000000-0000-0000-0000-000000000000';
then use that in my where clauses so I only have to update it in one place when it is used in dozens of places..
e.g. table where filter:
CompanyId = @myCompanyId
-
Thanks for the suggestion. You might be able to script this out using PowerShell and the SQL Data Compare cmdline - https://documentation.red-gate.com/sdc/using-the-command-line. Let us know if that works. Thanks!