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 |
swatib
Posting Yak Master
173 Posts |
Posted - 2006-06-26 : 08:18:42
|
HelloI wanted to delete data from all the databse user tables. How this is possible in sql server?Please explain in detailsThanksNjoy Life  |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-06-26 : 08:24:18
|
Begin withsp_msforeachtable 'select count(*) from ?' Then move on tosp_msforeachtable 'truncate table ?' Peter LarssonHelsingborg, Sweden |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-06-26 : 08:39:54
|
>>sp_msforeachtable 'truncate table ?'You will get error if there is referential integrity between tablesInstead of Delete, truncate themRefer thishttp://sqlteam.com/forums/topic.asp?TOPIC_ID=65341MadhivananFailing to plan is Planning to fail |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-06-26 : 13:54:05
|
"Instead of Delete, truncate them"You been up all night Madhi? I think you mean the other way round ... Kristen |
 |
|
swatib
Posting Yak Master
173 Posts |
Posted - 2006-06-27 : 01:45:48
|
Many thanks to all of you!!!Njoy Life |
 |
|
|
|
|