Hi there, could let me know how to reference to an excel database in SQL code?
I think
Select * from OPENROWSET ('Microsoft.Jet.OleDB.4.0', 'EXCEL 8.0;Database=C:\MyExcel1.xls',Sheet1$)
Would import everything from a spreadsheet but im not sure how you can reference individual columns?Select column_name from OPENROWSET ('Microsoft.Jet.OleDB.4.0', 'EXCEL 8.0;Database=C:\MyExcel1.xls',Sheet1$)
where .....
Showing posts with label oledb. Show all posts
Showing posts with label oledb. Show all posts
Wednesday, March 21, 2012
Monday, March 19, 2012
Importing Excel saved as XML
Hi guys!
I'm having troubles trying to import an excel file saved as XML.
Tried XML Source, Excel Source, OLEDB Source with no success.
Could someone point me to the right direction?
Thanks in advance.
I cannot see how you would do it without a custom script component as a source which opens the file with Excel automation (Not ideal).You could (maybe) create your own XSD to allow SSIS to understand the document and create proper column / rows for you but you might end up doing a lot for nothing.
Can you not get it as a normal XLS file?
Wednesday, March 7, 2012
Importing data from excel
Hi all,
I use the following to import data from Xl.
SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
This creates a new table. How could I alter this statement to update an
existing table
Thanks
RobertINSERT dbo.tablename
SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
Good luck
"Robert Bravery" wrote:
> Hi all,
> I use the following to import data from Xl.
> SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
> 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
> This creates a new table. How could I alter this statement to update an
> existing table
> Thanks
> Robert
>
>|||Thanks. I must ahad something wrong
Robert
"Derekman" <Derekman@.discussions.microsoft.com> wrote in message
news:C6B20B05-F0BF-4A3E-BD17-1782B9CB1FF2@.microsoft.com...
> INSERT dbo.tablename
> SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
> 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
> Good luck
> "Robert Bravery" wrote:
>|||Robert Bravery wrote:
> Hi all,
> I use the following to import data from Xl.
> SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
> 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
> This creates a new table. How could I alter this statement to update an
> existing table
> Thanks
> Robert
>
>
Instead of using "SELECT * INTO <newtablename> FROM", use "INSERT INTO
<existingtablename> SELECT * FROM".
I use the following to import data from Xl.
SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
This creates a new table. How could I alter this statement to update an
existing table
Thanks
RobertINSERT dbo.tablename
SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
Good luck
"Robert Bravery" wrote:
> Hi all,
> I use the following to import data from Xl.
> SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
> 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
> This creates a new table. How could I alter this statement to update an
> existing table
> Thanks
> Robert
>
>|||Thanks. I must ahad something wrong
Robert
"Derekman" <Derekman@.discussions.microsoft.com> wrote in message
news:C6B20B05-F0BF-4A3E-BD17-1782B9CB1FF2@.microsoft.com...
> INSERT dbo.tablename
> SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
> 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
> Good luck
> "Robert Bravery" wrote:
>|||Robert Bravery wrote:
> Hi all,
> I use the following to import data from Xl.
> SELECT * INTO XLImport5 FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
> 'Excel 8.0;Database=C:\test\xltest.xls', 'SELECT * FROM [Customers$]')
> This creates a new table. How could I alter this statement to update an
> existing table
> Thanks
> Robert
>
>
Instead of using "SELECT * INTO <newtablename> FROM", use "INSERT INTO
<existingtablename> SELECT * FROM".
Subscribe to:
Posts (Atom)