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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to delete data from all the tables?

Author  Topic 

markshen2006
Starting Member

15 Posts

Posted - 2008-04-07 : 14:51:08
I want to reset my application and delete all the data in all tables.

But I have question for this.

1. I do not know how to loop over all the tables and delete data.
2. the database have database diagram so threre are dependency with tables so the delete order is hard to decide.

Please give me a idea.

Thanks

Mark

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-07 : 14:55:11
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65341

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-07 : 14:55:33

This will help:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=65341 id="Lucida Console">
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-04-07 : 14:56:17
Spirit,

This is technical Echo which we get in SQLteam.com
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-07 : 15:04:24


usually we use this pic for those situations:


tag is [s n i p e d] without spaces

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -