.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Replicating to a pre-populated table

Posted By:      Posted Date: October 10, 2010    Points: 0   Category :Sql Server

I have an interesting scenario where I need to replicate from a system/master database to a number of subscribers, each of which have independent and unique data already existing in the table that needs to be replicated to. So basically the master database contains only system level data, and this system level data should be pushed out to all subscribers, each of which may have existing nonsystem data already in the replicated tables.

As an example assume I have the following tables:

Create table FormTemplate (id int, templateName varchar(100), companyId int null)

Create table Form(id int, templateId int, companyId int not null)

The FormTemplate table may have rows in the system database to represent system level form templates (eg a null companyid) - all of these system formtemplates should be pushed across to all the subscribers so its possible to create a Form entry in the subscriber referencing the templateId of the system template that has just been replicated. At the same time, each of the subscribers may have its OWN FormTemplate records defined which will exist in that database and ONLY in that database - this data should remain after synchronisation with the system database.

Assuming that identity range management isnt an issue, is it possible to achieve this using replication or is this kind of behaviour not really supported?

View Complete Post

More Related Resource Links

Replicating a table to it's duplicate with different physical /index structure

Hello,  We're planning to replicate a very large table (about 1TB) -- Yes Table, not database.  Can afford only very little (10-20 min)  downtime.    Is it possible to have clean replication with the source table in the source database (non partitioned) to destination table in the destination database (partitioned and indexed differently than the source) ?   Although data is the same.     We're primarily doing this replication for paritioning sake , as we can't afford downtime.  So the plan is to replicate the entire source database to the destination.   There are 2-3 large tables that hold 80% of the database data.   So when both DBs are in sync, we'll repoint the production.


Null value causing problems in variables populated from table during fetch



I have some tsql that interates through a table, pulls the column values from the table into variables and then uses these variables to construct another variable to use as the @body parameter for an email.

The code works perfectly as long as all the columns in the table have values however, if any are null then the variable is not constructed and the body of the email is blank.

How can I deal with the fact that there will always be some columns in my table that are null?


Only first row of a repeating table is being populated from a sharepoint list secondary data source


I have a reapeating table in maind atat source and I am trying to  populate it from values in a secondary data source, but when I am trying to do that it is only populating first row, leaving all other rows blank.


How to get this working..

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

Insert value using Table Value Functions

a real gem in Sql Server 2008. mostly people still using Stored procedure may be they shifted to SQL Server but they are not using TVF right now.

Using jQuery to Filter Table Rows

The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

RadioButton Groups, Table Rows And NamingContainers in asp.net

The RadioButtonList. Very handy for inviting users to select just one item from a list although because of the screen real estate it takes up, used less and less in favour of the DropDownList. In plain HTML, the browser knows to enforce the unique selected value amongst a list of radio buttons because they all have the same value for their name attributes.

RadioButton Groups, Table Rows And NamingContainers

(In which AJAX-enhanced CheckBoxes become more useful than RadioButtons but inheritance saves the day, and a simple RadioButton-derived control establishes the purpose of a control's naming container)

The RadioButtonList. Very handy for inviting users to select just one item from a list although because of the screen real estate it takes up, used less and less in favour of the DropDownList. In plain HTML, the browser knows to enforce the unique selected value amongst a list of radio buttons because they all have the same value for their name attributes.

Building a 3-Tier App with Silverlight 3, .NET RIA Services, and Azure Table Storage

Silverlight 3, .NET RIA Services, and Windows Azure Services Platform makes a 3-tier Cloud application easier to build: Silverlight 3 as presentation tier, .NET RIA services as the business logic and data access tier, and Windows Azure Table as the data storage tier. The sample application in this article demonstrates the architecture with a simple Survey application with all these technologies working together from Windows Azure.

Temporary tables in SQL Server vs. table variables

When writing T-SQL code, you often need a table in which to store data temporarily when it comes time to execute that code. You have four table options: normal tables, local temporary tables, global temporary tables and table variables. I'll discuss the differences between using temporary tables in SQL Server versus table variables.

Import XML File to SQL Table

Here is a brief example of importing an XML file into SQL Server table. This is accomplished by using the BULK option of OPENROWSET to load the file, and then utilizing the XQuery capabilities of SQL Server to parse the XML to normalized table format. This example requires SQL server 2005 or SQL Server 2008.

First, the following XML is saved to XML file C:\Products.xml.

Adding the table row below a particular row.


What is the best method in jQuery to add an additional row to a table as the row below a particular row?

Checkboxes from data table


I have a data table that contains some values for Certifications.  This table can be updated in a different part of my application.  On the web page I am currently working on, I would like to have check boxes appear for every value in the data table.  I have been struggling with this trying to use a For Each loop and I cannot get it to work for anything.  Any suggestions? 

I am using the following Razor syntax to obtain my data (I know this works because I can display it in a WebGrid):


var db = Database.Open("MyConn");

Display column from child table. Possible ?



I'am using dnamic entity with EF4. On a list page of a table, I would like to display a column containing information from a child table of the current element. Sample :

Order List :

Order Data | Required Date | Shipped Date | etc... | ... | Customer Name (foreign key with tostring() method override) | Customer Postal Code (Column that I want to add) |

I don't known how to do that. Is it possible ? Maybe I have to to create my own Metadata proxy that will add dynamicly a column on the MetaColumn list of the table.

Does someone have an easier or better idea ?

Thank you for any help.

Create new sql table at runtime VB.Net


I want to create a new table to sql database at runtime.  The column names would be "Name", "Date", "Event".  I would also like to have one more column name "Image" but the problem is that since the amount of images will vary, I want the application to count the amount of files in the Multiple fileuploader and then add a image column to the table for the respected amount of files. 

For example if i am uploading 3 files in the multiple fileuploader, the names should be "Name", "Date", "Event", "Image1", "image2", Image3"

I also would like that table name to be name dynamically from the textbox Name when the user enters the information.

I have the following code to make a new table, but I dont know how to name the fields at runtime like previously asked please help!!!

Dim objConn As New SqlConnection("Server=<servername>;uid=<userid>;pwd=<password>;database=master")


How to get data from table based on four table



I need to know how to show top 30 records from four table

with fastest speed.. in ms sql server 2005..

hope You do the needfull


how to get id value from the row inserted in a table with thr trigger.


I have a reports table with column report id and and report version. I created a trigger on this table to execute an application to do some processing each time a row is inserted in reports table. I need to pass the new report id execute this application from the trigger. How do I get the report id from the row that was inserted?


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend