Select into vs Insert into in SQL Server

10 pts.
Tags:
SQL INSERT
SQL performance
SQL Server 2000
Hi experts, What is better between Select into vs Insert into in SQL Server when it comes to performance?

thx

ASKED: August 20, 2009  4:36 PM
UPDATED: September 1, 2010  4:21 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Select into is much much faster in terms of performance as it can run in minimally logged mode. For this, you need to have the database in Bulk-Logged recovery. When you use Bulk-Logged recovery, and when you execute a Select into command, it is considered a bulk operation. But you would lose the option of doing a point in time recovery while using the log backup that has a bulk operation in it.

Another difference you may already be aware of is that select into creates the destination table but does not have any constraints created similar to base table. Incase of Insert followed by a select, your destination table needs to be created ahead of time.

Thanks
Rajesh Ramadas

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • AshishBajpai
    Could you please show some examples.
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following