The sum of all SQL Server matter that exist,
and the space in which all SQL Server events
occur or could occur.
Welcome to SQL Server Universe.com Sign in | Join | Help
in
Home SS SLUG Forums Articles Photos Downloads

export/import data

Last post 09-16-2008, 16:18 by methsika. 2 replies.
Sort Posts: Previous
  • export/import data

     09-14-2008, 9:32

    • Joined on 08-10-2008
    • Posts 9
    • Points 0
    • Top 25 Contributor
    how can i write a query to import or export data to a excel sheet or word doc not using the wizard in sql server 2005?
  • Re: export/import data

     09-15-2008, 12:06

    • Joined on 11-22-2006
    • Colombo, Sri Lanka
    • Posts 102
    • Points 0
    • Top 10 Contributor
      Male
    Hi Methsika,

    You can use OPENROWSET for loading data into SQL Server. Here is a sample code;

    SELECT *
       FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=D:\Test.xls;HDR=NO','SELECT * FROM [Sheet1$]')


    Let us know if need more clarification.
  • Re: export/import data

     09-16-2008, 16:18

    • Joined on 08-10-2008
    • Posts 9
    • Points 0
    • Top 25 Contributor

    hi,

    can you explain me what are those parameters in that function and how to export data to an excel or word file in that way?

    thanks.

View as RSS news feed in XML

(Best viewed with a resolution of more than 1024 * 768)

Powered by Community Server, by Telligent Systems