Showing posts with label along. Show all posts
Showing posts with label along. Show all posts

Friday, March 9, 2012

Merge replication GUIDs.

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
"synchronise" 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).
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, or is the rowguid field maintained by the replication process?
Thanks.
Let replication create this column. If you don't create it exactly right
replication will add a new column of its own.
Merge replication will auto supply the guid values. You should not specify
them in your insert statements. So if your table looks like this
Create Table Test
(pk int not null,
charcol char(20),
rowguid uniqueidentifier default newid())
Your insert would look like this
insert into test (pk, charcol) values (1, 'test')
Note that you do not need to supply the value of the rowguid col.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
message news:d7php9$ca4$1$830fa7a5@.news.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
> "synchronise" 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).
> 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, or is the rowguid field maintained by the replication process?
>
> Thanks.
>
>

Wednesday, March 7, 2012

Merge Replication deployment model

In order to deploy the replication implementation along with the software that has been created,how to package the correct set of necessary assemblies along with our client to ensure that the software can function correctly?
While trying to include the SQL Server assemblies that we are using from the SDK directory, we get some internal security token errors.

Please also suggest what would be the recommended deployment model for stand-alone clients which are replicating between a local and remote server where the local doesn't include an install of the SQL management tools? (It will have express.)

What are the assembiles you are getting error on?

If your client is going to install SQL Express (with replication components) before your application will be installed, you will not have problems.

Also you could make SQL Express as a pre-requisite when you publish and that way the client will be able to install Express and then your application will not have any problems with dependencies.