Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6562343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:41:53+00:00 2026-05-25T13:41:53+00:00

I have tables A, B and C in database. I have to put the

  • 0

I have tables A, B and C in database. I have to put the result obtained from A and B into table C.

Currently, I have an SP that returns the result of the A and B to the C# application. This result will be copied into table C using “System.Data.SqlClient.SqlBulkCopy”. The advanatge is during the insert using bulkcopy, log files are not created.

I want to avoid this extra traffic, by handling the insert in the SP itself. However, it should not be using any log files. Any way to achieve this?

Please share your thoughts.

Volume Of Data: 150,000

Database : SQL Server 2005

The database is in full recovery model; it cannot be changed.. Is SELECT INTO usefull in such scenario?

EDIT: When I use System.Data.SqlClient.SqlBulkCopy, the operation is getting completed in 3 mnutes; in normal insert it takes 30 minutes… This particular operation need not be recovered; however other operations in the database has to be recoveed – hence I cannot change the recovery mode of the whole database.

Thanks

Lijo

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:41:53+00:00Added an answer on May 25, 2026 at 1:41 pm

    You can use SELECT INTO with the BULK_LOGGED recovery model in order minimise the number of records written to the transaction log as described in Example B of the INTO Clause documentation (MSDN):

    ALTER DATABASE AdventureWorks2008R2 SET RECOVERY BULK_LOGGED;
    GO
    -- Put your SELECT INTO statement here
    GO
    ALTER DATABASE AdventureWorks2008R2 SET RECOVERY FULL;
    

    This is also required for bulk inserts if you wish to have minimal impact on the transaction log as described in Optimizing Bulk Import Performance (MSDN):

    For a database under the full recovery model, all row-insert operations that are performed during bulk import are fully logged in the transaction log. For large data imports, this can cause the transaction log to fill rapidly. For bulk-import operations, minimal logging is more efficient than full logging and reduces the possibility that a bulk-import operation will fill the log space. To minimally log a bulk-import operation on a database that normally uses the full recovery model, you can first switch the database to the bulk-logged recovery model. After bulk importing the data, switch the recovery model back to the full recovery model.

    (emphasis mine)

    I.e. if you don’t already set the database recovery model to BULK_LOGGED before performing a bulk insert then you won’t currently be getting the benefit of minimal transaction logging with bulk insers either and so the transaction log won’t be source of your slowdown. (The SqlBulkCopy class doesn’t do this for you automatically or anything)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my database I have tables that define types for example Table: Publication Types
When I have tables in my database that have PK/FK relationships (int) and when
I have several database tables that just contain a single column and very few
I have two tables in my database: NEWS table with columns: id - the
I have many tables in my database which are interrelated. I have a table
I am making webpage where data from database are put in a table. Each
I am working with a legacy database schema that looks like this: product_table table
I have a resultSet that I am pulling from my database: String selStmt =
I have written some thing like this to fetch data from the database. public
I have two tables in my MySQL database, users and tweets, as follows: TABLE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.