Sql Replication Guid Field


Author
Message
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
What you'll need to do is leave the business object's PrimaryKeyIsAutoIncremented property to True. This will inform the business object that the server needs to assign the GUID value. Then, just like you said, put the NewSequentialID() function as the default value for a column. When your business object saves the record, it will insert a NULL value for the PK and retrieve the assigned value from the server, just as if it was an IDENTITY column.
Paul Chase
Paul Chase
Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)Advanced StrataFrame User (806 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
I am planning on using replication between branch offices and the corporate office. Using replication requires a guid field in each table which is fine, I am even considering using it as my primary keys as each office's data will be consolidated into one db.

The real problem I am having is the column with the Guid type is set to have a default value of newsequentialid() which from what I have read eliminates alot of the index issues with using guids by making the id sequential. How do I configure the BO to pass default to allow sql to generate newid. I know I can generate a guid on the .net side but it does not seem to be sequential.

Thanks

P

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search