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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:43:10+00:00 2026-05-24T23:43:10+00:00

I want to insert data from one table into another. Both tables have about

  • 0

I want to insert data from one table into another. Both tables have about 100 columns.
They don’t have the same structure, but “almost”: the source table has about 20 columns fewer- some of them are NOT NULL. For those columns, I have to define a default, of course.

My first trial resulted in an error message (surprise surprise):

Column name or number of supplied values does not match table definition

But in my complex case, this message is not really helpful. Is there a way to get a more precise error message?

  • 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-24T23:43:10+00:00Added an answer on May 24, 2026 at 11:43 pm

    Suggest making your query easier to read, rather than relying on the error message from the RDBMS. One thought:

    • Put each column on its own line.
     INSERT INTO TargetTable (
        Col1,
        Col2,
        ....
     )
     SELECT 
        Col1,
        Col2,
        ....
     FROM SourceTable
    
    • create a new Excel sheet.
    • In SQL Server Management Studio, Alt-F1 your TargetTable; copy-paste the Column_name (and perhaps the Nullable values) into Excel sheet’s ColumnA.
    • Copy/paste the TargetTable columns into ColumnB.
    • Run a macro or visually inspect/adjust the differences. The nullables you mention, you’ll have to know offhand.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to insert data from one of my existing table into another
I want to move data from one database's table to another database's table. I
I need to write a script to insert data selected from one table into
I want to move some data from one table to another. I wrote a
I want to export data from one table into a new one with a
I want to be able to insert data from a table with an identity
I want to insert data into a table where I don't know the next
I need to copy some data from one table to another in Oracle, while
Im trying to copy over data from one table to another in the same
I want to port data from one server's database to another server's database. The

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.