February 27, 2009 at 11:56 pm
HI FRIENDS
HERE I READ THE DATAS FROM EXCEL SHEET USING THIS QUERY
SELECT *
FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
'Data Source=d:\rptinvitmisstrfregsumm.xls;Extended Properties=Excel 8.0')...[Sheet1$]
BUT I NEED
FROM TABLE TO NEW EXCEL SHEET..
THANKS IN ADVANCE..
February 28, 2009 at 12:27 am
In SSMS, use the Import/Export wizard....it is much more easier
February 28, 2009 at 7:54 am
Just a sugestion
/*
This is an example of how to output to Excel.
Note will not output to Excel 2008
Criteria: Spread sheet must exist on the SERVER,
with row 1 acting as column headers must be the name
of the table field(s) being exported
Excellent article with sample code:
http://www.simple-talk.com/sql/t-sql-programming/sql-server-excel-workbench
*/
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'Excel 8.0;Database=D:\MSSQL\Test.xls', 'SELECT * FROM [Sheet1$]')
SELECT * FROM yourtables name
You might also want to read this article:
http://www.sqlservercentral.com/articles/Integration+Services/61542/
For Excel 08 - note using new OLEDB driver:
SELECT * FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0;Database=d:\dasdgigs.xls',
'SELECT * FROM [dasdgigs$]')
March 1, 2009 at 3:24 am
You can do it the complex way, or using a query tool that can work with different databases (SQL, MySQL, Excel) and let you work and do whatever you wish with your data.
--------
SQL Data compare , Synchronize data from diffrent surces, and many other SQL tools[/url].
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply