How to Truncate a Table in Sql Server - Digital Tool Factory blog How to Truncate a Table in Sql Server - Digital Tool Factory blog

How to Truncate a Table in Sql Server

I hadn’t used this handy tool in sql server in a while and actually had to look it up recently, so here it is in the code review.

TRUNCATE TABLE “table_name”

Truncating not only deletes all of rows in the table, but it deletes all information about the table, which makes all auto numbering integer fields start over at 1.  Not complicated, but surprisingly few people know about it.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

 

Written By Steve French

 

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.