July 16, 2015 at 12:39 pm
Why is it if you publish an article such as a view it breaks if you do not include all of the underling tables you have to refresh the snapshot?
Is there a work around?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 16, 2015 at 4:16 pm
Is there a work around?
If it's possible to index the view that would would be an option.
-- Itzik Ben-Gan 2001
July 17, 2015 at 4:46 pm
Alan.B (7/16/2015)
Is there a work around?
If it's possible to index the view that would would be an option.
That is not going to work.
Thanks.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 17, 2015 at 5:31 pm
Welsh Corgi (7/17/2015)
Alan.B (7/16/2015)
Is there a work around?
If it's possible to index the view that would would be an option.
That is not going to work.
Thanks.
That's bummer. I have never replicated a non-indexed view and can't imagine how it would work in a transaction or merge replication environment.
-- Itzik Ben-Gan 2001
July 17, 2015 at 7:55 pm
The problem is that if I add the view as an article and I miss a table referenced in the view. The snapshot agent bombs out and I'm forced to do another Snapshot.
I'm looking for an alternative.
Thanks, 🙂
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 23, 2015 at 8:34 am
If you want to use the view in a publication, you need to include the underlying tables as the view itself is only held as a definition. The best thing to do is to check for dependencies before you add the view to the publication.
I have not used indexed views, but I believe they can be replicated without the underlying tables as the data is held in the view.
If you are using the view to hide columns in the underlying table, you could set up the publication to replicate only those columns you need. Be careful if you do this as sorting out an inconsistent publication is messy, especially when you have multiple subscribers.
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply