VS2013 database project - ignore schemas/tables matching filter?
Asked Answered
M

1

6

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.

Mckeown answered 19/2, 2015 at 15:2 Comment(1)
I'm not aware of any way of doing this natively. I've read about some people writing plug-ins to do that during the publish phase, but that's as far as I saw that. You may want to investigate Red-Gate's Schema Compare if this is ongoing.Arnett
T
2

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!

Tsingyuan answered 5/3, 2015 at 11:47 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.