Question

  Asked: Feb 20 2008   7:41 PM GMT
  Asked by: Getmygto


Replication in SQL Server 2005 deleting records


SQL Server 2005, SQL Server 2000, Replication

We just converted from SqL 2000 to 2005. We were replicating from 2 instances on the same server every 30 minutes. A record from Intsnace A was copied to Instance B, then the record in A was deleted. Worked great for years. Now with 2005 it is deleting the records on B on the second pass. We think it is performing the delete function from the last replication process. anybody hear of this or know how to stop the delete action from being performed?

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



The records on instance B are supposed to be deleted. That's the default behavior of replication.

If you look inside the database on instance B you should see some funky stored procedures that you didn't create. Edit the delete one(s) for the table(s) that you don't want the data deleted from. After the CREATE PROCEDURE ProcedureName ... AS put a RETURN(0) to break of the procedure before the record is actually deleted. The procedure will look something like this.

CREATE PROCEDURE ProcedureName
@Column1 DataType
...
@LastColumn DataType
AS
RETURN(0)
...
GO
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SQL Server and Database.

Looking for relevant SQL Server Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny  |   Feb 20 2008  10:14PM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.

 

Mrdenny  |   Feb 22 2008  6:20AM GMT

Did this work for you?