I need to delete about 3 million rows from a table that is part of a merge
publication. I think that I will have to copy out the rows that I want to
keep into a temp table and truncate the table and then copy the rows back in.
My question is how best to go about this? I think that the best way is to go
into the publication properties and uncheck the table on the articles tab.
Then to carry out the same process of copying out the data to be kept,
truncate the table, then move the rows to be kept back in. Then add the
article back into the publication. In order for the article to replicated
after adding it back in would I have to do a snapshot or would it resume by
itself?
Russell,
this sounds OK. However if the publication already has a subscription, you
won't be able to remove the individual article and you'll have to drop the
entire subscription before proceeding. You could drop the subscription,
remove the rows on publisher and subscriber then do a nosync initialization.
HTH
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts
Friday, March 30, 2012
Need to change Logshipping monitor server
Hey, is there an easy to change logshipping monitor server? I don't want to delete my whole configuration and recreate it from scratch just to add a monitor server. Right now, I don't have a monitor server for one db and when I go to the properties window for the db, it doesn't let me add the monitor server. I have done it in the past by dropping the configuration for Logshipping and then recreating it. Thank you.
Hi Tej,
Unfortunately you will need to first remove LS in order to alter the Monitor instance. Someone may suggest a dodgy workaround, but I would be very cautious following this advice...
Cheers,
Rob
Wednesday, March 21, 2012
Need some help!
I was playing with my computer and deleted the "run" program. I didn't want to delete it but now my computers says it has a restriction when I try to open "run". It says "this operation has been cancelled due to a restriction in effect on your computer."It wont let me open MS-DOS. Does anyone know how to bypass this problem?Deleted the Run program Hahahahahah ! (unless u have one in Unix ?)
Yeah Right !!!
Hrummpphhh !
Yeah Right !!!
Hrummpphhh !
Monday, March 19, 2012
Need script that can shrink copy of DB to fit on a notebook
I need a script that will take a 40GB 300+ table database and shrink it to the 1st 1000 rows in each table and delete security tables like tblchargecard. Want to get size to about 1gb to fit on a notebook for development. Any suggestions would be appreciated.declare a table variable with two columns, table_name and Table_rowcount.
From a join between sysindexes and sysobjetcs table, get the table names and their respective rowcounts into this table variable.
update the table_rowcount columns with table_rowcount-1000
write a script to automatically generate delete statements for each table, each delete statement being preceded by set rowcount table_rowcount and followed by set rowcount 0 statement.
run this generated script.|||Creative, but I think that will crash if you have relational integrity established, and especially if you are using cascading deletes.
If your database does have cascading deletes, (as it should) then just delete everything but, say, every 10th record, out of the highest level tables in the schema. (You can use something like WHERE Right(PrimaryKey, 1) <> 0 if you have numeric keys, for instance.) Do this in a copy of the database, of course!
As far as "delete security tables like tblchargecard", you'll have to specify those in your script.|||Thanks for the help from both of you. will give this a try.
From a join between sysindexes and sysobjetcs table, get the table names and their respective rowcounts into this table variable.
update the table_rowcount columns with table_rowcount-1000
write a script to automatically generate delete statements for each table, each delete statement being preceded by set rowcount table_rowcount and followed by set rowcount 0 statement.
run this generated script.|||Creative, but I think that will crash if you have relational integrity established, and especially if you are using cascading deletes.
If your database does have cascading deletes, (as it should) then just delete everything but, say, every 10th record, out of the highest level tables in the schema. (You can use something like WHERE Right(PrimaryKey, 1) <> 0 if you have numeric keys, for instance.) Do this in a copy of the database, of course!
As far as "delete security tables like tblchargecard", you'll have to specify those in your script.|||Thanks for the help from both of you. will give this a try.
Subscribe to:
Posts (Atom)