Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

Why use both TRUNCATE and DROP?

Asked by Ben Phillips Apr 10, 2021 261 views 1 answer
Share

About this question

 In the system, I work on there are a lot of stored procedures and SQL scripts that make use of temporary tables. After using these tables it's good practice to drop them. Many of my colleagues (almost all of whom are much more experienced than I am) typically do this: TRUNCATE TABLE #mytemp DROP TABLE #mytemp I typically use a single DROP TABLE in my scripts. Is there any good reason for doing a TRUNCATE immediately before a DROP?


Your answer

1 Answer

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.