Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

Truncate all table of database at once using sp_MSForEachTable

Oct 4 2011 10:44PM by Alpesh Patel   

EXEC sp_MSForEachTable 'TRUNCATE TABLE ?'

Instead of ? you can place a name of table.

Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Alpesh Patel
36 · 5% · 1663
12
 
6
 
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

1  Comments  

  • It isn't a straight forward query as you have provided. If you are talking about a whole database then I expect atleast some constaints to be there :) Check this the post which I have few years back to handle such scenarios as well - http://vadivel.blogspot.com/2006/07/easiest-fastest-way-to-delete-all.html

    commented on Oct 5 2011 8:37PM
    Vadivel
    484 · 0% · 79

Your Comment


Sign Up or Login to post a comment.

"Truncate all table of database at once using sp_MSForEachTable" rated 5 out of 5 by 12 readers
Truncate all table of database at once using sp_MSForEachTable , 5.0 out of 5 based on 12 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]