473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Insert into a table that has identity column

Hi All,

I have a to insert a set of rows into a table which is on some other server, and that table has an identity column which is also a primary key of that column.

I am getting the error 'Table 'myremoteserver.myremotedatabase.dbo.myremotetable ' does not exist or cannot be opened for SET operation' if the statement
SET IDENTITY_INSERT 'myremoteserver.myremotedatabase.dbo.myremotetable ' on
is written before the insert statement.

Also If I dont include that column in the select statement which is after insertion, I get the following error message "Insert Error: Column name or number of supplied values does not match table definition.
"

Can someone please help me how to solve this problem.

Thank you.
Jun 21 '07 #1
3 3267
kestrel
1,071 Expert 1GB
I am moving this to the Forum.

--
Kestrel
Jun 22 '07 #2
debasisdas
8,127 Expert 4TB
Before inserting records ,please check table defination(structure) properly.

Both should match.
Jun 22 '07 #3
Hi All,

I have a to insert a set of rows into a table which is on some other server, and that table has an identity column which is also a primary key of that column.

I am getting the error 'Table 'myremoteserver.myremotedatabase.dbo.myremotetable ' does not exist or cannot be opened for SET operation' if the statement
SET IDENTITY_INSERT 'myremoteserver.myremotedatabase.dbo.myremotetable ' on
is written before the insert statement.

Also If I dont include that column in the select statement which is after insertion, I get the following error message "Insert Error: Column name or number of supplied values does not match table definition.
"

Can someone please help me how to solve this problem.

Thank you.
It should match the number of parameters to insert with the number of columns in table.
Jun 23 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Jason | last post by:
The best way to explain this is by example. I have a source table with many columns. Source SYMBOL EXCHANGE_NAME CUSIP TYPE ISSUE_NAME
1
by: Alain Filiatrault | last post by:
HI, I have an SQL Server table with only 1 column. That column is an identity column. How can I insert a row in this table using SQL syntax? I tried insert into T_tableName () values ()...
2
by: Dave | last post by:
I cannot insert into my appointments table because the primary key and identity column, appt_id, cannot be added. What do I have to change in my SQL statement to add new records into this table? I'm...
2
by: JP SIngh | last post by:
I am having problems inserting data into a simple table Insert into Forums (Title, PageUrl, ContractId) Values ('54249', 'test01.asp',54249) Microsoft OLE DB Provider for SQL Server error...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
8
by: Bri | last post by:
Greetings, I'm having a very strange problem in an AC97 MDB with ODBC Linked tables to SQL Server 7. The table has an Identity field and a Timestamp field. The problem is that when a new record...
7
by: trint | last post by:
This: string strSQL2 = "INSERT INTO tblTravelDetailMember(memberId, " + " TravelDetailUplineId, " + " rankId, " + " TravelDetailId, " + " CreatedDateTime, " + " Operator) " + "VALUES ('" +...
8
by: shenanwei | last post by:
I have 2 same windows machine, same instance configure and Database , all run DB2 UDB V8.1.5 Test 1 : create table OUT_1 (LINE VARCHAR(350), LINENUMBER INTEGER NOT NULL GENERATED ALWAYS AS...
9
by: rhaazy | last post by:
Using MS SQL 2000 I have a stored procedure that processes an XML file generated from an Audit program. The XML looks somewhat like this: <ComputerScan> <scanheader>...
5
by: .Net Sports | last post by:
I'm trying to insert records into an sql database coming from a page using the request ..form method. The table "general" has a primary key 'geid .' I get the following error: Cannot insert the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.