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 |
|
amirmuthu
Starting Member
12 Posts |
Posted - 2008-02-18 : 06:35:20
|
| hello Experts, Please can you any one say the query to delete all tables records from database. because i don't want write delete query for each tableThanks & Regards,MuthuKrishnan Gurusamy,Confluence Systems,Chennai. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
|
|
amirmuthu
Starting Member
12 Posts |
Posted - 2008-02-18 : 06:42:07
|
| if i dont have a primary key then how to delete.Please adviceThanks & Regards,MuthuKrishnan Gurusamy,Confluence Systems,Chennai. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-18 : 06:44:23
|
exec sp_msforeachtable 'truncate table ?' E 12°55'05.25"N 56°04'39.16" |
 |
|
|
amirmuthu
Starting Member
12 Posts |
Posted - 2008-02-18 : 06:46:03
|
| what is it? exec sp_msforeachtable 'truncate table ?' |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-18 : 06:48:36
|
It truncates all records from all tables in your current database.try exec sp_msforeachtable 'print ''?''' E 12°55'05.25"N 56°04'39.16" |
 |
|
|
amirmuthu
Starting Member
12 Posts |
Posted - 2008-02-18 : 07:00:29
|
| Thanks its working fine |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|