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.
Author |
Topic |
kjmraohyd
Starting Member
34 Posts |
Posted - 2006-06-27 : 08:30:13
|
Ihave the following statement deletes all the rows but I get FK violations for some ogf the Tables. select 'delete from '+name from sysobjects where type='u'How to take care of the delete from child first and then parent?Jagan |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
X002548
Not Just a Number
15586 Posts |
|
rockmoose
SQL Natt Alfen
3279 Posts |
Posted - 2006-06-27 : 13:55:08
|
" I thought you couldn't truncat tables with RI"Nope you can't, have to delete.Ever run a delete script until there were no more errors? |
 |
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-06-27 : 14:31:46
|
hmmm. the topic was "How to delete all tables"Does this not meet the requirements?USE MASTERDROP DATABASE [your database here] EDIT: Someone posted an AWESOME script a while back that scripted out all constraints, and removed them in the right order, THEN put them back, in the right order. I will dig around and see if i can find a link to it.Help us help YOU!Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx*need more coffee*SELECT * FROM Users WHERE CLUE > 0(0 row(s) affected) |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|