import data from excel only from specific cells

  • 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

  • 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.

  • 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/

  • couldnt you copy the excel schema into a table form and sync up the rows and columns that way?

  • 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$]')

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply