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 |
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2009-05-15 : 01:28:27
|
| I have to truncate data from all tables of a database except few tables.i m using sp_msforeachtable 'delete from ?'it truncates whole database but i have to truncate only few tables.plz help ,,,its urgentVed Prakash Jha |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-05-15 : 01:59:37
|
You can write an IF clause in the parameter string. E 12°55'05.63"N 56°04'39.26" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
chriztoph
Posting Yak Master
184 Posts |
Posted - 2009-05-31 : 23:17:36
|
| [code]SELECT 'TRUNCATE TABLE ' + TABLE_NAMEFROM INFORMATION_SCHEMA.TABLES[/code]then copy the tables to the text editor you want to truncate the execute |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-06-01 : 02:25:40
|
quote: Originally posted by chriztoph
SELECT 'TRUNCATE TABLE ' + TABLE_NAMEFROM INFORMATION_SCHEMA.TABLES then copy the tables to the text editor you want to truncate the execute
You can't truncate table which is referenced by a FOREIGN KEY constraint. See the link I postedMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|