Replicate Indexed View as a Table

  • Guys,

    Does anyone know how I could replicate an Indexed View so that it ends up as a Table (not a view)? After setting up the replication I get the following error message:

    "Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber. "

    Again I don't want to replicate it as a view but as a Table. I can't find any option in SQL Server 2005 which I could change to do this. Any help will be greatly appreciated.

    Thanks.

  • You can replicate views to table...

    or you can use a query too to replicate to table...

    Check the BOL topic "Publishing Data and Database Objects " and "Filtering Published Data"

     

     

    MohammedU
    Microsoft SQL Server MVP

  • i know I can replicate views to table (only indexed views) and i know i can use a query to replicate to table. But my question is HOW? I could select "indexed view logbased" in SQL Server 2000 when setting up replication to replicate to a table but it's not available in SQL Server 2005.

  • Malik (3/2/2007)


    i know I can replicate views to table (only indexed views) and i know i can use a query to replicate to table. But my question is HOW? I could select "indexed view logbased" in SQL Server 2000 when setting up replication to replicate to a table but it's not available in SQL Server 2005.

    Malik, you cannot (so far as I can tell) do that through the GUI or Wizards, but you can do it through scripting and stored procedures.

    After you create most of your publication, add the indexed view using @Type = 'Indexed View logbased'

    On trick you can use to get the Gui to do most of the work, is have it generate the script to add the indexed view, but don't let it actually run it. Instead take the script to SSMS and change the @type parameter from the default of "indexed view schema only" to "indexed View logbased".

    ---
    Timothy A Wiseman
    SQL Blog: http://timothyawiseman.wordpress.com/

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply