Groups | Blog | Home
all groups > sql server replication > january 2007 >

sql server replication : Can I assign rowguid from the client code instead of using default newid()?


AlterEgo
1/5/2007 4:06:34 PM
Alex,

Yes,

CREATE TABLE dbo.Table1
(
test uniqueidentifier NOT NULL ROWGUIDCOL
) ON [PRIMARY]

ALTER TABLE dbo.Table1 ADD CONSTRAINT
DF_Table1_test DEFAULT (newid()) FOR test

-- Bill

[quoted text, click to view]

Alex via SQLMonster.com
1/5/2007 11:39:48 PM
Do I have to use default newid() for the rowguid? I would prefer to pass a
sequential GUID from the client code instead.

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-replication/200701/1
Alex via SQLMonster.com
1/5/2007 11:56:50 PM
Or can I at least use newsequentialid() instead of newid() as the ROWGUID
default?

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-replication/200701/1
Alex via SQLMonster.com
1/6/2007 3:17:13 AM
Thank you for your response. It seems your code is still using newid(), but
anyway it is not what I was asking. The MS documentation says that one can
create replication ROWGUID column manually as long as it have the following
characteristics:

* The data type as UNIQUEIDENTIFIER.
* The default as NEWID().
* The ROWGUIDCOL property.
* A unique index on the column.

My questions are:
1. Can I use newsequentialid() instead of newid() ?
2. Can I supply GUID from my client code instead of using this default value?

I am interested in transactional replication model with updating subscribers.


[quoted text, click to view]

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-replication/200701/1
Hilary Cotter
1/7/2007 8:17:37 AM
absolutely.

--
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



[quoted text, click to view]

Hilary Cotter
1/7/2007 2:12:37 PM
This seems to be SQL 2000 specific.

--
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



[quoted text, click to view]

Hilary Cotter
1/7/2007 2:14:16 PM
here is something SQL 2005 related
http://msdn2.microsoft.com/en-us/library/ms152770.aspx

--
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



[quoted text, click to view]

Alex via SQLMonster.com
1/7/2007 5:24:31 PM
What about the following thread then? Is it just SQL CE specific or same will
be true for SQL Server 2005?
http://www.sqlmonster.com/Uwe/Forum.aspx/sql-server-ce/505

I still cannot understand the reason why MS added the second requirement
(newid() as default for ROWGUID) in this MSDN article:
http://msdn2.microsoft.com/en-us/library/aa237151(sql.80).aspx

--
Message posted via http://www.sqlmonster.com
Alex via SQLMonster.com
1/8/2007 12:14:52 PM
Thanks a lot for the link. Do you have any idea why the ROWGUID column was
read-only in the following case?

http://www.sqlmonster.com/Uwe/Forum.aspx/sql-server-ce/505

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-replication/200701/1
AddThis Social Bookmark Button