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


import data from excel only from specific cells


import data from excel only from specific cells

Author
Message
sasken
sasken
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1988 Visits: 1933
Hello Everyone,

Hope all is well.

I was wondering if I can import data from an excel sheet only from specific cells to sql server 2008 r2. I can we can do this through sql import task but I want to know I can select data from specific cells only.

Thanks for your help.

“If your actions inspire others to dream more, learn more, do more and become more, you are a leader.” -- John Quincy Adams
Yev-704641
Yev-704641
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 77
WHen adding Excel Source and under "Show Advanced Editor" and in Component Properties you could specify your own OpenRowset like Sheet1$A3:H3 where A3 is first column and H3 is last column to read data from.
Yev-704641
Yev-704641
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 77
If you need something in specific cell you could look at this. I was looking for something similar and found it very useful.

http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/70024/
raym85
raym85
SSC-Addicted
SSC-Addicted (402 reputation)SSC-Addicted (402 reputation)SSC-Addicted (402 reputation)SSC-Addicted (402 reputation)SSC-Addicted (402 reputation)SSC-Addicted (402 reputation)SSC-Addicted (402 reputation)SSC-Addicted (402 reputation)

Group: General Forum Members
Points: 402 Visits: 198
couldnt you copy the excel schema into a table form and sync up the rows and columns that way?
Kevin.roberts25
Kevin.roberts25
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 12
try using an open query


SELECT [Col1], [Col2], [Col3] INTO DestinationTable FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=C:\YourFolderLocation\yourFileName.xls;Extended Properties=Excel 8.0')...[WorkSheetName$]

SELECT [Col1], [Col2], [Col3] INTO DestinationTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\YourFolderLocation\yourFileName.xls', [WorkSheetName$])

SELECT [Col1], [Col2], [Col3] INTO DestinationTable FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\YourFolderLocation\yourFileName.xls', 'SELECT * FROM [WorkSheetName$]')


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