Monday, March 26, 2012
Rights problem after replication
I've got a snapshot replication problem. My master database has some
tables which are replicated on 2 read-only databases. In every
database, I have the same roles, but not the same users. When I
replicate the database, every rights on my replicated tables are
erased ! What's the problem ?
Thanks for your help !!
Are you using SQL Server 2000? In this case you'll need a pre-snapshot script
to create the user if he owns any tables. If not the user and the permissions
can be in a post-snapshot script. For SQL 2005 there is a new option on
sp_addarticle (0x40000000) to add the permissions.
HTH,
Paul Ibison
|||On 31 mai, 11:23, Paul Ibison <Paul.Ibi...@.Pygmalion.Com> wrote:
> Are you using SQL Server 2000? In this case you'll need a pre-snapshot script
> to create the user if he owns any tables. If not the user and the permissions
> can be in a post-snapshot script. For SQL 2005 there is a new option on
> sp_addarticle (0x40000000) to add the permissions.
> HTH,
> Paul Ibison
Hello and thank you for your quick answer !
Yes, I'm using SQL Server 2000. How can I create this pre-snapshot ?
I've already a sql file that contain the grant's list.
TIA, pem
|||On the snapshot tab in the publication properties there is an option to
browse for a TSQL file.
Cheers,
Paul Ibison
Monday, March 12, 2012
reverse merge repliction
hi
I have notice that i missed few columns in my merge repliction and i wonder is it possiblie to reverse a replicated database or copy to normal SQL database?
after that i would do a new Publication.
I need to have the data that is in the Database.
If this is SQL Server 2005, you can always use alter table and add the new columns to the table. They should automatically propagate to the subscriber.
If you wish you can drop the publication, add the columns and reset the publication too.
The data in the tables will be intact.
reverse merge repliction
hi
I have notice that i missed few columns in my merge repliction and i wonder is it possiblie to reverse a replicated database or copy to normal SQL database?
after that i would do a new Publication.
I need to have the data that is in the Database.
If this is SQL Server 2005, you can always use alter table and add the new columns to the table. They should automatically propagate to the subscriber.
If you wish you can drop the publication, add the columns and reset the publication too.
The data in the tables will be intact.
Friday, March 9, 2012
reusing a single conversation handle
Hi
I have a replicated table that has a trigger attached to the it. The trigger fires off a service broker message for inserts. Originally for every insert, I would begin a conversation, send, and end the conversation when target send an end conversation. Since replication process is only using a single spid, I would like to reuse 1 conversation. the following is what I have for the send procedure in the initiator. I check the conversation_endpoints for any open conversation, if it's null, I start a new conversation and send else just send with the existing conversation. Is there anything wrong with this code? What could cause the conversation on the initiator to be null if I never end the conversation on the initiator side? thanks
DECLARE @.dialog_handle uniqueidentifier
select @.dialog_handle = conversation_handle from sys.conversation_endpoints where state = 'CO'
IF @.dialog_handle is NULL
BEGIN DIALOG CONVERSATION @.dialog_handle
FROM SERVICE [initiator]
TO SERVICE 'target'
ON CONTRACT [portcontract];
SEND ON CONVERSATION @.dialog_handle
MESSAGE TYPE [Port] (@.msg)
Hi
Reusing conversations is generally a good idea and one good way to achieve this is to store a mapping of spid to conversations handle in a lookup table. http://blogs.msdn.com/remusrusanu/archive/2007/05/02/recycling-conversations.aspx goes into the details and helps answer your questions.
Thanks
Ketan