SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Replicate Indexed View as a Table


Replicate Indexed View as a Table

Author
Message
Malik-273753
Malik-273753
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 61

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.


MohammedU
MohammedU
SSCarpal Tunnel
SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)

Group: General Forum Members
Points: 4636 Visits: 812

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
Malik-273753
Malik-273753
SSC-Enthusiastic
SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)SSC-Enthusiastic (139 reputation)

Group: General Forum Members
Points: 139 Visits: 61
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.
timothyawiseman
timothyawiseman
SSCrazy
SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)SSCrazy (2.3K reputation)

Group: General Forum Members
Points: 2346 Visits: 920
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/
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search