Tuesday, March 20, 2012

Create and drop vs. truncate table when using inside procedure

 

Truncate

Create and drop

 

When used inside a procedure recompilations will happen

 

Permissions on the table has to set or the user must have create table permission

minimally logged.

More transaction log space

 

When you use create and drop inside a procedure then the procedure might fail when its executing from multiple users or if some creates a table with the same table as mentioned in the procedure

Also check the truncate vs. delete: http://www.calsql.com/2012/03/truncate-vs-delete.html

No comments:

Post a Comment

Featured Post

SQL Server AWS Migration BCP

stored procedure to generate BCP scritps to migrate the SQL Server database. Developed this stored procedure on my labs to simulate t...

Contributors