HELP ME

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

  • In SSMS, use the Import/Export wizard....it is much more easier

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

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • 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