Guarding Views in data warehouse

  • 20 March 2023
  • 2 replies

Userlevel 4
Badge +5

Dear all,

Do any of you have a way of guarding Views in the data warehouse?

I have some views which I for archiving purposes rather not delete, but this is giving me issues when I want to deploy the project as a whole.



Best answer by daniel 22 March 2023, 10:17

View original

2 replies

Userlevel 2

Hi Daniel, 

As far as I know it is not possible to gaurd views on deployment. Seems like a good feature request!

You can remove all parameters of a view which means the view will no longer be reactive to other objects in the DWH and should no longer be marked as dirty. This way they will not be included in a differential deploy. For organisation, you could consider placing them in their own ‘archive’ schema (also handy for access rules). 

Alternatively, you can manually move the views to a new schema using SSMS, and then delete them in the TimeXtender UI. If you remove the object ID's from the extended properties of the view in SSMS, the view should also not be deleted using SQL Database Cleanup Tool. You can always use ‘script’ → ‘create view as’ in SSMS to retrieve the syntax stored in the view. 

Kind regards,

Andrew - E-mergo 

Userlevel 4
Badge +5

Hi Andrew,

Thanks for the great sugestions. For me the best way would be not to change to many thing in the view, because that could possibly be a lot of rework later on when the view needs to be active again. 

A collegue at the client side has solved it like this (for now):
In the view he has left the ‘Create View [Schema].[TableName] AS’ and added in the line underneath: SELECT 1 AS hide
And then a multi line comment, commenting all everything. This is the least amount of work and it is in no way destructive. Until there is a guard possibility in TX I think I like this option.