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 6133819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:16:38+00:00 2026-05-23T17:16:38+00:00

Although there is no reason (apart maybe from aesthetics) to use INSERT INTO SELECT

  • 0

Although there is no reason (apart maybe from aesthetics) to use INSERT INTO SELECT when inserting a single row in a table, is there any difference between using this and INSERT INTO VALUES?

  • 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-23T17:16:38+00:00Added an answer on May 23, 2026 at 5:16 pm

    Using the INSERT INTO ... SELECT approach allows you to pick your values from another table, based on some criteria.

    INSERT INTO dbo.TargetTable(Col1, Col2, ...., ColN)
       SELECT Col1, Col2, ..., ColN
       FROM dbo.SourceTable
       WHERE (some condition)
    

    That might be a bit easier and more readable to write, rather than having to retrieve 20 values from your source table, stash them into temporary variables, just so you can then call your INSERT INTO dbo.Destination(....) VALUES(......) statement…

    DECLARE @Value1 INT
    DECLARE @Value2 DATETIME
    ....
    DECLARE @ValueN INT
    
    SELECT 
          @Value1 = Col1,
          @Value2 = Col2,
          ....
          @ValueN = ColN
    FROM 
        dbo.SourceTable
    WHERE
         (some condition) 
    
    INSERT INTO dbo.TargetTable(Col1, Col2, ...., ColN)
    VALUES(@Value1, @Value2, ....., @ValueN)
    

    But in the end – it’s just an INSERT statement that inserts data – it’s really just a matter of personal preference and which approach is easier / more convenient to use….

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

Sidebar

Related Questions

Is there any reason why I should not use an Integer as primary key
I have the following code that won't compile and although there is a way
Possible Duplicate: What should a good BugTracking tool be capable of? Although there is
Although I deeply fell in love with the MVVM pattern there seem to be
If it's any help, there is also a similar class in C#'s WebRequest. Although
I wasn't aware of a difference, but a coworker says there is, although he
Although there are still bots harvesting emails, I'm wondering if you hide email addresses
Although there are some threads on here about .net charting controls, I'm starting new
There is a select box with an onchange function that enables and shows /
Is there any reason why my present working directory is not on my Ruby

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.