Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is it possible to replicate a view from a SQL server to another one?

I know a view is composed of tables. Can I replicate a view anyway?

like image 210
developer.cyrus Avatar asked Jul 10 '09 03:07

developer.cyrus


People also ask

Can views be replicated in SQL Server?

These views contain information that is used by replication in Microsoft SQL Server. The views enable easier access to data in replication system tables. Views are created in a user database when that database is enabled as a publication or subscription database.

Can view be replicated?

"All types of replication allow you to replicate views. The view (and its accompanying index, if it is an indexed view) can be copied to the Subscriber, but the base table must also be replicated.", Books Online article.

How do I copy a view from one database to another?

Open SQL Server Management Studio. Right-click on the database name, then select "Tasks" > "Export data..." from the object explorer. The SQL Server Import/Export wizard opens; click on "Next". Provide authentication and select the source from which you want to copy the data; click "Next".


2 Answers

For SQL SERVER 2008
Have a look at the link http://msdn.microsoft.com/en-us/library/ms152559.aspx. This explains all the objects that can be replicated.

For SQL Server 2005
http://msdn.microsoft.com/en-us/library/ms152559(SQL.90).aspx

like image 124
Atul Avatar answered Nov 08 '22 04:11

Atul


Yes.

You would need to add the view to the Publication (along with the underlying tables)

like image 28
Mitch Wheat Avatar answered Nov 08 '22 06:11

Mitch Wheat