0

I need to import excel files into SQL server 2008 SSMS manually and only load those items into the database which are new not the existing ones. please find me SQL Query for the same.

SuperSonic
  • 17
  • 1

2 Answers2

1

I would suggest that you can use SSIS in this situation. I guess there is no straight forward query to handle this situation. First you need to load data into the staging table and then you have to move the new records only. Please refer here for T-SQL command Import Excel spreadsheet columns into SQL Server database

Community
  • 1
  • 1
sganesh
  • 89
  • 6
0

You can use OPENROWSET function shown here http://beyondrelational.com/modules/2/blogs/70/posts/10846/export-to-excel-with-column-names.aspx

Madhivanan
  • 13,244
  • 1
  • 23
  • 28