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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:48:21+00:00 2026-05-17T22:48:21+00:00

my goal is to select items from a table and append those items into

  • 0

my goal is to select items from a table and append those items into another table located on a remote database on the same server. All columns in both tables match up and are identical. In this case,

I have the tsql:

INSERT INTO db1.dbo.tblitems 
     SELECT * 
       FROM db2.dbo.tblitems i2 
      WHERE i2 = 'import'

i get an error saying:
An explicit value for the identity column in table ‘db1.dbo.tblitems’ can only be specified when a column list is used and IDENTITY_INSERT is ON.

any ideas why this doesn’t work?
thanks in advance

  • 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-17T22:48:22+00:00Added an answer on May 17, 2026 at 10:48 pm

    Sounds like there is an identity column in the table. An identity column is a column that is made up of values generated by the database. For example:

    create table #TestTable (id int identity, name varchar(50))
    insert into #TestTable select 1, 'Will Smith'
    

    This gives the identity column error. You can avoid that in two ways: the first is not to insert the identity column, like:

    insert into #TestTable (name) select 'Will Smith'
    

    The second is to use set identity_insert (requires admin privileges):

    set identity_insert #TestTable on
    insert into #TestTable (id, name) select 1, 'Will Smith'
    set identity_insert #TestTable off
    

    In both cases, you have to specify the column list.

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

Sidebar

Related Questions

My goal is to select articles where the primary_category_id ( articles table) or any
Looking at the document, the goal is to select the second cell from the
My ultimate goal is to allow users to select a file from a dialog
In Mysql, I want to select the bottom 2 items from each category Category
Is it possible to remove items from all dropdowns, except from the one where
I have a table Items which stores fetched book data from Amazon. This Amazon
I need to select min ID value from top 5 rows in the table.
I'm trying to generate a tree structure from a table in a database. The
My goal is to have a user select a year and a month. Translate
My goal is to be able to have the user select a range of

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.