473,779 Members | 1,873 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New to merge replication - simple scenario......


I have a product that sits on a main server and wish to implement
functionality to allow salesmen to come along, pick up a snapshot of the
database, go away and maybe modify/add to it and then come back and
"synchronis e" their data. I'm reading up on Merge Replication for this
purpose. But anyway, I created a publisher on my server and it went away
and generated a "rowguid" column on all of my tables (my tables all have an
Identity column key field). Now of course my "Inserts" no longer work, as
they expect a GUID. I would have expected SQL Server to automatically
generate a guid for new inserts (in a similar way to it's TIMESTAMP), but it
appears it doesn't, despite the fact I have "(newid())" as the default for
the column. It always inserts the same value:
{00000000-0000-0000-0000-000000000000}.

So, back to basics, now I have a guid field for each record, how do I manage
inserts?

Thanks.

Jul 23 '05 #1
3 1529

"Robin Tucker" <id************ *************@r eallyidont.com> wrote in
message news:d7******** ***********@new s.demon.co.uk.. .

I have a product that sits on a main server and wish to implement
functionality to allow salesmen to come along, pick up a snapshot of the
database, go away and maybe modify/add to it and then come back and
"synchronis e" their data. I'm reading up on Merge Replication for this
purpose. But anyway, I created a publisher on my server and it went away
and generated a "rowguid" column on all of my tables (my tables all have
an Identity column key field). Now of course my "Inserts" no longer work,
as they expect a GUID. I would have expected SQL Server to automatically
generate a guid for new inserts (in a similar way to it's TIMESTAMP), but
it appears it doesn't, despite the fact I have "(newid())" as the default
for the column. It always inserts the same value:
{00000000-0000-0000-0000-000000000000}.

So, back to basics, now I have a guid field for each record, how do I
manage inserts?

Thanks.


Good practice is to explicitly name the target columns in all your INSERTs,
eg:

insert into dbo.MyTable (col1, col2)
select col1, col2
from dbo.MyOtherTabl e

If you do this, then there's no problem - your INSERT works as usual, and
you can ignore the uniqueidentifie r column completely. Since there's a
default on it, there's no need to include it in the INSERT.

Simon
Jul 23 '05 #2
So am I right in thinking that the unique GUID will be created on the field
when data is pushed or pulled - as I say, the newid() seems to produce a
zero'd GUID. I was thinking I am responsible for maintaining the uniqueness
of this ID, but this can't be right.
"Simon Hayes" <sq*@hayes.ch > wrote in message
news:42******** **@news.bluewin .ch...

"Robin Tucker" <id************ *************@r eallyidont.com> wrote in
message news:d7******** ***********@new s.demon.co.uk.. .

I have a product that sits on a main server and wish to implement
functionality to allow salesmen to come along, pick up a snapshot of the
database, go away and maybe modify/add to it and then come back and
"synchronis e" their data. I'm reading up on Merge Replication for this
purpose. But anyway, I created a publisher on my server and it went
away and generated a "rowguid" column on all of my tables (my tables all
have an Identity column key field). Now of course my "Inserts" no longer
work, as they expect a GUID. I would have expected SQL Server to
automatically generate a guid for new inserts (in a similar way to it's
TIMESTAMP), but it appears it doesn't, despite the fact I have
"(newid())" as the default for the column. It always inserts the same
value: {00000000-0000-0000-0000-000000000000}.

So, back to basics, now I have a guid field for each record, how do I
manage inserts?

Thanks.


Good practice is to explicitly name the target columns in all your
INSERTs, eg:

insert into dbo.MyTable (col1, col2)
select col1, col2
from dbo.MyOtherTabl e

If you do this, then there's no problem - your INSERT works as usual, and
you can ignore the uniqueidentifie r column completely. Since there's a
default on it, there's no need to include it in the INSERT.

Simon

Jul 23 '05 #3

"Robin Tucker" <id************ *************@r eallyidont.com> wrote in
message news:d7******** ***********@new s.demon.co.uk.. .
So am I right in thinking that the unique GUID will be created on the
field when data is pushed or pulled - as I say, the newid() seems to
produce a zero'd GUID. I was thinking I am responsible for maintaining
the uniqueness of this ID, but this can't be right.


<snip>

As far as I'm aware, in the case of uniqueidentifie r columns added to
support merge replication, it's the replication process that maintains these
values. But I'm not at all an expert in replication, so you might want to
consider posting to microsoft.publi c.sqlserver.rep lication if you need more
details.

Simon
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4826
by: Karthik | last post by:
Hi, We have setup a publisher and a distributor in SQL 2000 running SP3. Alongwith this we have setup a merge replication agent and its running successfully inside the same network. I allow anonymous subscriptions and the merge publication works successfully for anonymous pull subscriptions also. Now i am trying to setup the same scenario to setup replication over the Internet using FTP. I have created a FTP site and given certain...
0
2050
by: Gert Wurzer | last post by:
Hi! I hope anyone can help me with this very important problem! Since configurig one subscriber in our merge replication scenario to a subscribing publisher we get a lot of merge conflicts type 10 reason code 2. Because we have the german version i translate the reason text as meaningful as possible: The row was updated at 'publisher.database' but could not be updated
1
1426
by: Angelo Mariani | last post by:
Hi, guys. A very simple question for all of you: how can I get the amount of bytes exchanged during a Merge replication between two Microsoft SQL 2000 servers? Thank you. Bye, Angelo.-
3
4096
by: jaykchan | last post by:
One of the table that is in a merge replication somehow is missing an index. Strangely, only the table in one of the subscriber of the merge replication is missing the index; another subscriber and the publisher of the merge replication don't have this problem. How should I add the missing index back to that table? My understanding is that making structural change on a table that is in merge-replication is different from making change on...
1
1835
by: Andrew Chanter | last post by:
I developed 3 different replicated database applications in MS Access for 3 different corporate clients in Access 97 several years ago to enable data to be shared across wide area networks. I observed 2 issues that plagued all 3 systems. 1. the database files continually became corrupt during synchronization. Most times this was easily fixed via a repair and compact, but the frequency with which this occurred was of concern, and...
3
536
by: Chris Rennert | last post by:
Hello all, We were just getting started on a small project using SQL Server Express on our PC's and we already had SQL Server 2k Enterprise on our main Server. Problem is , we cannot do merge replications between the two. From what i have read this is not possible, but it blows my mind, especially with how new SQL Server 2k5 is, that they would force developers to stick with MSDE 2k, rather than utilize SQL Server Express in order to...
1
2028
by: EoRaptor013 | last post by:
We have a situation almost exactly like that in the MS documentation vis a vis peer-to-peer replication. We have three servers and three user groups, one each in Chicago, New York, and Bermuda. Because of our business practices, we are fairly confident that only one group will be updating a given record at any one time but the users will be updating their own local database servers and those updates must appear on all three servers....
8
7882
by: Benzine | last post by:
Hi, I have an issue with my replication at the moment. I will try to describe the scenario accurately. I am using MS SQL 2000 SP4 with Merge Replication. Subscribers connect to the publisher to upload/download changes. I have a trigger set up on one table which updates another, here is an example of the trigger: "CREATE TRIGGER qt_t_projTotal ON dbo.qt_quotes
5
1612
balabaster
by: balabaster | last post by:
I have an odd scenario whereby I have two SQL 2005 Servers separated by a firewall and the only means of them talking is via a 3rd party message queueing server. I have a database on each of the SQL servers that needs to be replicated in both directions...this network architecture is not of my doing and security dictates that this cannot change. In my test environment I've just started investigating how exactly I'm going to approach this...
1
10071
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5501
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.