SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Import excel file to sql server table


Import excel file to sql server table

Author
Message
keywestfl9
keywestfl9
Mr or Mrs. 500
Mr or Mrs. 500 (595 reputation)Mr or Mrs. 500 (595 reputation)Mr or Mrs. 500 (595 reputation)Mr or Mrs. 500 (595 reputation)Mr or Mrs. 500 (595 reputation)Mr or Mrs. 500 (595 reputation)Mr or Mrs. 500 (595 reputation)Mr or Mrs. 500 (595 reputation)

Group: General Forum Members
Points: 595 Visits: 764
i want to append rows from excel file to sql server table

Table has a identity column.

How do i achieve it thru SSIS or thru DTSWizard? I get error if i the identify column with null value in excel sheet.
Peter Brinkhaus
Peter Brinkhaus
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2247 Visits: 7404
Check the 'Keep Identity' checkbox off in the Destination Editor (it's the FastLoadKeepIdentity property in the Properties box, which must be false).

Peter
Powichrowski Marek
Powichrowski Marek
Right there with Babe
Right there with Babe (777 reputation)Right there with Babe (777 reputation)Right there with Babe (777 reputation)Right there with Babe (777 reputation)Right there with Babe (777 reputation)Right there with Babe (777 reputation)Right there with Babe (777 reputation)Right there with Babe (777 reputation)

Group: General Forum Members
Points: 777 Visits: 514
keywestfl9 (1/23/2008)
i want to append rows from excel file to sql server table

Table has a identity column.

How do i achieve it thru SSIS or thru DTSWizard? I get error if i the identify column with null value in excel sheet.


Identity column has null value? Impossible.
KennyClarck
KennyClarck
Right there with Babe
Right there with Babe (773 reputation)Right there with Babe (773 reputation)Right there with Babe (773 reputation)Right there with Babe (773 reputation)Right there with Babe (773 reputation)Right there with Babe (773 reputation)Right there with Babe (773 reputation)Right there with Babe (773 reputation)

Group: General Forum Members
Points: 773 Visits: 75
remove your identity column output before the import operation
//Ravi
//Ravi
Old Hand
Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)

Group: General Forum Members
Points: 308 Visits: 451
Hi,

I do this all day. I don't know what's your knowledge level on SSIS, so I would assume it's basic.

use data flow task in SSIS. Under "Data Flow" tab, drag Excel source and OLE DB destination. Make connection to your excel file and database in Connection Manager. Make sure you are using excel 2003 sheet, It doens't recognize Excel 2007. In Data Flow tab, double click on excel source, slect appropriate connection, and then sheet. Click on Columns and check the columns you want to transfer. Take the green arrow and attach it the database destination task. Double click database destination task. Here is what's important, make sure you check "keep null values." Select correct database connection and the table. Its better to create the table here, becuase it creates the table by taking column names in your excel file. Also, make sure your column with null values isn't set as primary key. Then, execute the ask and you should be golden.

Ravi.

------------
Smile
ChrisM@Work
ChrisM@Work
SSC-Insane
SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)SSC-Insane (22K reputation)

Group: General Forum Members
Points: 22191 Visits: 19709
Importing data into a live table isn't generally good practice unless it's a repetitive process and problems have been sorted on previous imports.
Instead, import into a staging table, which should be a full or partial copy (columnwise) of the target table with no constraints. Check the new data once it's in the staging table, then import into the live table. Then purge or delete the staging table. Much safer, much easier to check.

“Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Exploring Recursive CTEs by Example Dwain Camps
ab_abhisingh
ab_abhisingh
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 4
hi ;
i m working on vista operating system and i m connected with a remote server(sql server 2000) and i m also connected with sql sever 2005 on my own system.
i m able to import excel sheet in sql server 2005 by 'openrowset' but
i m unable to import a excel sheet on remote server (sql server 2000)
from my system....
pls help me .....
//Ravi
//Ravi
Old Hand
Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)Old Hand (308 reputation)

Group: General Forum Members
Points: 308 Visits: 451
What DB engine are you using to connect to SQL 2000?♠

------------
Smile
ab_abhisingh
ab_abhisingh
Forum Newbie
Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)Forum Newbie (6 reputation)

Group: General Forum Members
Points: 6 Visits: 4
actually i use sql server 2005 and i hv connected sql server 2000 which is on server..
and when i import an excel sheet which is on my own desktop to remote server by openrowset method then i face problem.......
pls tell me....
kescott
kescott
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 24
Is it possible to SQLBULKCOPY
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search