Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Replicate Indexed View as a Table Expand / Collapse
Author
Message
Posted Thursday, March 1, 2007 1:31 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, April 25, 2013 10:09 AM
Points: 33, Visits: 60

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.

Post #348632
Posted Thursday, March 1, 2007 10:27 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 9:15 PM
Points: 1,190, Visits: 609

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
Post #348695
Posted Friday, March 2, 2007 9:46 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, April 25, 2013 10:09 AM
Points: 33, Visits: 60
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.
Post #348840
Posted Friday, November 7, 2008 5:56 PM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Friday, April 4, 2014 4:40 PM
Points: 751, Visits: 917
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/
Post #599356
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse