INSERT INTO SELECT * FROM tblName IN 'Db Location'

mathematician

New Member
Joined
Aug 24, 2015
Messages
45
Hi,
I'm trying to consolidate data from multiple access databases into SQL Server. The code works fine but the only drawback is when there is a new column in a source access database table 'Db Location' it results into an error. Is there a way in SQL where I can specify to SKIP unmatched fields?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
can you give an example of what you mean by an unmatched field? Is this in your Select clause? Or your Where clause or Join clause?
 
Upvote 0
can you give an example of what you mean by an unmatched field? Is this in your Select clause? Or your Where clause or Join clause?
I mean some columns that are in FROM table but are not in INTO table. I want to ignore them and continue appending records. As it stands it gives an error when there is any column in the FROM table that do not exist in INTO table. My sql statement is

INSERT INTO tblINTO SELECT * FROM tblFROM IN 'tblFROM_DB_LOCATION'
 
Last edited:
Upvote 0
There is probably no simple was to do this with plain SQL. I suppose there are tools that would allow it (such as SSIS import export mappings or who knows what else might be available these days). I could imagine ways to do this with vba but building out code like that would probably take longer than just fiddling with the tables and the SQL as you go.
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,215
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top