Showing posts with label idea. Show all posts
Showing posts with label idea. Show all posts

Thursday, March 22, 2012

Deleting Database with replication

Roy,
I have no idea what 'hand picture' is, but to disable
replication on the database you can use sp_dboption or
databasepropertyex. To use sp_dboption, pass the database
name as the parameter.
published
merge publish
and set the above parameters to false.
Rgds,
Paul Ibison, SQL Server MVP,
www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Other than what Paul said you can also go to tools, replication, configure
publishers, distributor, and subcribers; and click on the publication
databases tab, and then uncheck the databases you want to stop
sharing/publishing.
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

Tuesday, February 14, 2012

Delete multiple tables

Hi everyone,

I spent a lot of time on this, but still have no idea how to get it working

This are the tables with forign keys that I have:

Table1 has table_1_id, table_1_data columns
Table2 has table_1_id, table_2_id, table_2_data columns
Table3 has table_2_id, table_3_id, table_3_data columns
Table4 has table_3_id, table_4_id, table_4_data columns

If I delete a row in table1, any related rows in table2 should be deleted, and at the same time, any rows in table3 which are related to table2 and related to table1 should be deleted as well and so on...

is there a way that I can write a SQL query to do it?

I am using MS SQL 2000 and ASP.net C#

Many thanks

EricLookup "cascading referential integrity constraints" in BOL, you can use the on delete cascade function for your foreign keys

HTH|||Originally posted by rhigdon
Lookup "cascading referential integrity constraints" in BOL, you can use the on delete cascade function for your foreign keys

HTH

Thanks for the information, this gives me a good hint. But I don't know what "BOL" means, could you explain it to me?

Thanks a lot

Eric|||Sorry, BOL is Books-online. It comes installed with SQL and is the best resource a SQL developer has (in the grand scheme of things) If you do not have it installed, you should and if you have not downloaded the latest BOL from MS (SP3A) you should and can at this location.

http://www.microsoft.com/downloads/details.aspx?FamilyID=683D71A6-BCF4-45A6-A2E2-F6AB5BE3EF12&displaylang=en

GL