Sql-server – Maintaining permissions on a replicated view after reinitialization

permissionsreplicationsql-server-2012view

When we were on SQL Server 2005, there was some way that I was able to keep custom permissions on a view at the subscriber.

Now that I'm on SQL Server 2012, there doesn't seem to be a way to do that.

In the article properties of a table, there is the "Action if name is in use" property "Truncate all data in the existing object" which will keep any permissions on the table.

However, views do not have this option. It is either "Keep existing object unchanged" or "Drop existing object and create a new one." If I update my view, I want the changes to be reflected in the replicated view, but I don't want my custom permissions to disappear.

Am I looking at starting a post-reinitialization script for this purpose or is there something I'm missing?

Best Answer

I ended up using a post-initialization script to grant this permission at the subscriber and it worked great.