0

Is this the right place to ask the following?

I have 2 tables in two different MS Access DB's. Access allows the ability of inserting data from DBA.table1 into DBB.table1, using the format [dba].[table1].[dbb].[table1]. Here's my problem.

Using a single SQL Statement I can't figure out the following. DBA.table1 has a record, with let's say ID 300. DBB.table1 has a 300 already, matter of fact the ID goes all the way to 550.

How do a write an insert statement that gets the full record from DBB.table1, but swaps puts in the 'next available' ID, which in the case, for DBB.table1, is 551?

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by huangzhi
0

Please give some data for an example.
Or you can read help about :
1. SET IDENTITY_INSERT for inserting ID to another table.
2. IDENT_CURRENT('table_name') to return last ID.
3. DBCC CHECKIDENT to return last ID and corrects the identity value

0

Please give some data for an example.
Or you can read help about :
1. SET IDENTITY_INSERT for inserting ID to another table.
2. IDENT_CURRENT('table_name') to return last ID.
3. DBCC CHECKIDENT to return last ID and corrects the identity value

All of these examples are transact SQL. I need MS Access - does transact work there?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.