473,432 Members | 1,410 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,432 software developers and data experts.

How to import only new rows to MS SQL from Excel file

Hi All,

I am using MS SQL 2008 import/export utility to import an excel file that is regularly updated.
How can I use import /export utility every time to append only new rows to SQL table.
I an new to SQL and do not know SSIS as well, more familiar with import/export only.
Jul 6 '10 #1
3 2872
ck9663
2,878 Expert 2GB
It would be better if you IMPORT the entire excel file into a temp table, then you can compare it with your master table to see which records are new ones. You will need a primary key to identify which records are new or not.

Once identified, you can do whatever you want with the new record. Once your session is over, your temp table will be dropped or you may drop it explicitly.

Good Luck!!!

~~ CK
Jul 7 '10 #2
@mushtaqawais
Thanks Ck9663,

Is there any way to link SQL server with excel file, so that it automatically import & process data.
Jul 8 '10 #3
ck9663
2,878 Expert 2GB
Yes. But you're going to have to code it. You can use OPENROWSET() to retrieve the excel file and you can do whatever you want from there. To do this automatically, you're going to create a job and a predefined schedule for it to execute.

Good Luck!!!

~~ CK
Jul 8 '10 #4

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

Similar topics

1
by: Jake | last post by:
Hello, I was wondering if someone had a example of how to import an excel file into a sql database via asp.net? Thanks in advance. Jake
2
by: Siu | last post by:
Hi, I use the following code to export and import a file Excel from resp. into a Web page with the following code: //EXPORT Response.Clear(); Response.Buffer = true; Response.ContentType =...
0
by: ramnaresh_t yadav via .NET 247 | last post by:
Hi, I am pasting the code to import data from Text/Excel files into Database(Oracle ) Table... I think some one needs this .. they can use.. it... ======================= Dim dsDB As New DataSet...
2
by: Reza Solouki | last post by:
Hello, I never had to do anything with office tools programmatically till now(I guess there is first time for everything), so this might be a very silly and simple question for some of you. Any...
0
by: ramyanet | last post by:
Dear All, I have to enable feature of users to import thier excel file in my web application.I have used the Asp.net with Vb. when they click import button file open dialog must appear,then...
3
by: harshala | last post by:
I want to open excel file using open dialogue box and display records in datagrid
8
by: shenkel55 | last post by:
I'm using Access and Excel 2003. Using either the import wizard or code, I have the same problem. This problem only happens with Excel files automatically generated by Corp IT. If I try to do an...
16
by: giandeo | last post by:
Hello everybody I am trying to import an excel file for days into MS SQL Server 2000, unfortunately, I cannot see a ray of hope till now. I have surfed the WEB for hours, but again no...
5
by: sumanta123 | last post by:
Dear Sir, How to export/import the excel file in oracle database using sql promt. Please guide me the command(export/import) for the neddful. Thanks in Adavance. Regards Sumanta Panda
3
by: Ikrams | last post by:
Good day, This is Ikram again, need more help. Is there any possiblity for an Excel data can import in Foxpro? Appreciate your prompt help please. Ikram
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.