SQL Server Transaction Replication For Indexed Views

I am doing transaction replication for indexed views. I have other replicating schemabound views that reference the indexed views using the NOEXPAND hint. Even though I call sp_addarticle for the NOEXPANDing views after calling sp_addarticle for the indexed views, I'm getting the error:

Hint 'noexpand' on object '...' is invalid.

because SQL Server is trying to create the NOEXPANDing view at the target server before creating the index on the indexed view.

Is there a way to force SQL Server to finish replicating the indexed view indexes before starting on the NOEXPANDing views?

Answers


Have a look on the distributor database and you'll find scripts for pre and post replication. These are straight forward sql scripts so you can modify these and put whatever you like in them.

That means you could modify the pre-repl script to avoid the error and modify the post-repl script to add the noexpanding view after the index has been created.


Need Your Help

Simulate a POST request

jquery post node.js express

I am developing a node.js app using express. I'm listening on port 3000 of localhost for POST requests. The only way I know how to simulate a POST request is using jQuery.ajax():

How to make an iPhone dropdown-looking button

iphone objective-c uibutton

I've seen a dropdown-like button on many apps, including Turf Wars, that simulates a dropdown with a picker.

Spinner not working in android,

android android-arrayadapter android-spinner

I have made a simple demo for spinners in android,In that 2 activities are there in first activity a simple spinner and in second a textView.So when any item fromthe spinner is selected it will be