russell wrote:Truncate Table tableName
Truncate would be ideal on an empty table but it could be a radical move for anything else, tantamount to decapitation to cure a headache...
If the table is not empty, the primary intention for using TRUNCATE should be emptying the table and not just resetting the autoincrement counter.
If the table is empty, the "ALTER TABLE...AUTO_INCREMENT=1" (or its MSSQL equivalent) is equally efficient, except that if data is present, it will simply the reset the autoincrement counter to the highest ID + 1.
My concern with "TRUNCATE" is that it has the potential to be very destructive... It should be avoided for such "mundane" tasks and used with care...