Thursday, January 29, 2009

Import Sql Data To Excel

Hi,
Here is the Procedure to load the sql data to excel with out writing lot of code

1)In Excel Click the Menu Data -> ImportExternalData -> NewDataBaseQuery

2)You will get the window Choose DataSource. Select New Datasource -> click OK

3)In Create New Data Source, give the name for the Datasource .Select the driver as SqlServer
in the driver type.Click connect

4)Sql Server Login window opens ,Specify the Server Name.Click options Select the Database by default it will assign Master Database .Click Ok

5)Now the datasource will be connected.Select the table name to import your data in to excel.Click OK

6)Query Wizard Opens to select columns

7)Click the option .In the Table Options window there is a option to list only the tables,views, systemTables.Choose as per ur need.In the Owner select dbo.which excludes system tables.Click Next.Click Next

8)In query wizard- finish select the option view data or edit query in Microsoft Query.click Finish.

9)To execute your procedure click on File-> Execute Sql -> select Procedure

10)To import the data click File -> cancel and return to Microsoft excel

No comments: