|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 12:28 PM
Points: 76,
Visits: 304
|
|
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...
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 193,
Visits: 642
|
|
| 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.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Today @ 9:10 AM
Points: 587,
Visits: 759
|
|
| You can create indexed view on the Publisher based on your filter criteria and publish that view.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 193,
Visits: 642
|
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 12:28 PM
Points: 76,
Visits: 304
|
|
Yep. I did went with indexed views and going well so far.
Thanks for responding even on older thread. I appreciate it.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 193,
Visits: 642
|
|
| Glad its working out, thanks.
|
|
|
|