Programming4us
         
 
 
SQL Server

Microsoft SQL Server 2008 R2 : Setting Up Replication (part 3) - Horizontal and Vertical Filtering

12/14/2011 9:25:51 AM

Horizontal and Vertical Filtering

During the publication creation process, you could have done some filtering of the data, either horizontally or vertically (or both at the same time). Figure 19 illustrates all you need to do to vertically filter (in terms of limiting what gets published to a subset of columns of a table). As you can see, you uncheck the AccountNumber column for the Customer table so that it isn’t included in the article for that object in this publication. This might be done because account number information needs to be more tightly controlled within your company and shouldn’t be part of what is viewed by any subscribing systems.


Figure 19. Specifying a vertical filter on the Customer table (limiting the columns to be published).



In addition, you can specify horizontal filters by using the Filter Rows option on a publication (publication properties). This allows you to specify horizontal filtering on any table you publish. Figure 20 shows a typical row filter on the Customer table that results in publishing North East Territory customers only (that is, those with TerritoryID values of 1 or 2).

Figure 20. Specifying a horizontal filter on the Customer table (limiting the rows to be published).

Join filtering allows you to limit the rows you will publish, via join criteria, to another table. Figure 21 shows a complex join that filters SalesOrderHeader rows that correspond to North East Territory customers only (that is, those with TerritoryID values of 1 or 2).


Figure 21. Specifying a join filter on the SalesOrderHeader table (limiting the sales rows that will be published by joining for the North East customers only).

Other -----------------
- Microsoft SQL Server 2008 R2 : Setting Up Replication (part 2) - Creating a Publication
- Microsoft SQL Server 2008 R2 : Setting Up Replication (part 1) - Creating a Distributor and Enabling Publishing
- SQL Server 2008 R2 : Basing the Replication Design on User Requirements
- SQL Server 2008 R2 : Planning for SQL Server Data Replication & SQL Server Replication Types
- SQL Server 2008 R2 : Replication Agents
- SQL Server 2008 : Replication - Subscriptions
- SQL Server 2008 : Replication Scenarios
- Protecting SQL Server Data : CELL-LEVEL ENCRYPTION - Special Considerations
- Protecting SQL Server Data : SCHEMA ARCHITECTURE STRATEGIES - Harnessing Linked Servers
- Monitoring SQL Server 2005 Performance : Using Windows System Monitor & Using SQL Server Profiler
- Monitoring SQL Server 2005 Performance : Monitoring and Recording Performance
- SQL Server 2008 R2 : Replication - The Publisher, Distributor, and Subscriber Magazine Metaphor
- SQL Server 2008 R2 : Replication - What Is Replication?
- SQL Server 2008 High Availability : Other HA Techniques That Yield Great Results & High Availability from the Windows Server Family Side
- SQL Server 2008 High Availability : Building Solutions with One or More HA Options
- SQL Server 2008 High Availability : The Fundamentals of HA
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 4)
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 3) - Performing a Database Backup
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 2) - Common OS-Related Tasks
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 1) - General Tasks & Scheduling Scripts
 
 
Most View
- Developing for Windows Phone and Xbox Live : Multiplayer Games (part 4) - Building a Game Lobby
- Encryption basics for SQL Server : Key Algorithms
- Windows 7 : Creating and Enforcing Bulletproof Passwords (part 2) - Taking Advantage of Windows 7’s Password Policies
- Active Directory Domain Services 2008: Modify the Precedence for Password Settings Objects
- Windows Vista : Custom Startups with the Advanced Options Menu & Useful Windows Vista Logon Strategies
- Tuning Windows Vista’s Performance : Optimizing the Hard Disk
- Microsoft Exchange Server 2003: Configuring Recipient Objects (part 1) - Recipient Types
- SharePoint 2010 : Implementing and Configuring Information Management Policies (part 1) - Defining a Retention Policy
- BizTalk Server 2009 : Exposing WCF services from orchestrations
- jQuery 1.3 : Sharing a plugin with the world
Top 10
- SQL Azure : Other Considerations
- Administering SQL Server 2008 with PowerShell : Step-By-Step Examples (part 3) - Performing a Database Backup
- jQuery 1.3 : Working with numeric form data (part 3) - Parsing and formatting currency
- Tuning Windows Vista’s Performance : Optimizing the Hard Disk
- SharePoint 2010 : Change the Name, Description, Icon, or URL of a Site
- Performing Administrative Tasks Using Central Administration (part 4)
- Windows Phone 7 : Controlling Music Playback
- jQuery 1.3 : Working with numeric form data (part 7) - Deleting items
- Windows 7 : Enabling the Shutdown Event Tracker
- SQL Server 2008: Security and User Administration - Managing Securables