Replication Issues

  • 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/

  • Is there a work around?

    If it's possible to index the view that would would be an option.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • 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/

  • 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.

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • 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/

  • 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