Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2013 database project - ignore schemas/tables matching filter?

I have a database which includes many cached/generated tables. I'd like to exclude these (permanently) when I do a schema compare. Is there any way to configure the schema compare to ignore a specific schema or, even better, a specific object name? E.g. I'd like to ignore all tables within the "cache" schema whose name begins with "XYZ".

I realize that if I ignore an object once, its "ignore status" is persisted. However, I will still see it in the comparison results (figure 1,000 ignored tables, for example). I'm looking for a way to permanently hide, or simply not show ignored objects.

Another example would be if I wanted to split a large database into multiple, reusable projects. I may want to exclude certain schemas from each project when running a schema compare.

like image 432
Josh M. Avatar asked Feb 19 '15 15:02

Josh M.


1 Answers

You can't use this with the schema compare ui but if you deploy using sqlpackage.exe or publish in visual studio you can write a deployment contributor to allow exactly this i.e. remove certain steps from the deployment.

You need to write in c# (or vb.net) or there is a generic one you can use:

http://agilesqlclub.codeplex.com/

If you get stuck with it, give me a shout!

like image 105
Ed Elliott Avatar answered Nov 11 '22 13:11

Ed Elliott