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

replication design advice Expand / Collapse
Author
Message
Posted Monday, February 11, 2013 10:15 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, May 30, 2014 9:06 AM
Points: 78, Visits: 329
Hello Folks,

we are planning to replicate database for reporting purpose and we need to restrict data based on companyID'

we are not supposed to replicate any data that is greater than companyID five.(campanyid >5)

we have total of 50 tables and out of which companyID exists on 30 tables and I can easily apply row filter to filter the data by companyID >5 on these tables but the other 20 tables doesnt have companyid but those tables have information of all companies.

What is the best way to replicate other 20 tables data without sending restrcited data? I do have a way to get data of companies <5 but I need to apply multiple joins depending on tables.

As I cant apply joins with other tables at row filter level ,what are my possible options?

I thought of following but not sure if they are possible

1) alter the default I/D/U procedures by joining them with other tables to only replicate required data.

I am not sure if above option works but wondering how I can generate intial snaphot with this solution.

2)
Planning to create functions and use at row filter level but not sure if I can use functions at row filter level in replication. Yet to test this solution

3) replciate all data to reporting system and create views in top of tables to restrict data.

I dont think its a ideal solution but I just thought of it..


Please advice if you think of any better solution...


any advice is really appreicated...
Post #1418748
Posted Tuesday, April 30, 2013 11:29 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 3:05 PM
Points: 355, Visits: 870
I am not sure you can accurately partition your articles without that company identity column. Are the company names consistent across the tables that you can join to the company table on the name field? if so , add a company id column to those other tables. Always beware of views that depend on those tables that do a 'select *' (not a recommended practice). Otherwise, views and stored procedures are acceptable article elements.
Post #1448161
Posted Wednesday, May 1, 2013 12:52 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: 2 days ago @ 8:43 AM
Points: 820, Visits: 1,175
You can create indexed view on the Publisher based on your filter criteria and publish that view.
Post #1448574
Posted Wednesday, May 1, 2013 1:07 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 3:05 PM
Points: 355, Visits: 870
From MSDN,
http://msdn.microsoft.com/en-us/library/ms187864%28v=sql.105%29.aspx


Indexed views work best when the underlying data is infrequently updated. The maintenance of an indexed view can be greater than the cost of maintaining a table index.


Plus also keep in mind
an indexed view cannot reference tables from more than one database.
Post #1448584
Posted Wednesday, May 1, 2013 1:09 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, May 30, 2014 9:06 AM
Points: 78, Visits: 329
Yep. I did went with indexed views and going well so far.

Thanks for responding even on older thread. I appreciate it.
Post #1448587
Posted Wednesday, May 1, 2013 3:55 PM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 3:05 PM
Points: 355, Visits: 870
Glad its working out, thanks.
Post #1448638
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse