Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 delete data from table using script

Author  Topic 

sajitha
Starting Member

10 Posts

Posted - 2012-03-08 : 05:45:51
I got 10 tables, made relationship using foreign key and primary key.
I added some dummy data on it. Now I want to delete all dummy datas. I can't delete it because of REFERENCE CONSTRAINT. So I need help to write a script in order to delete all datas from table, when I run the script.

hank You

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-03-08 : 07:07:35
just delete in the right order.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-08 : 10:20:56
see

http://visakhm.blogspot.com/2011/11/recursive-delete-from-parent-child.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -