This article is about pulling data from SQL Server into Excel sheet .
Open Excel - > Under Data tab - > From Other Sources - > click the drop-down - > click on From SQL Server .
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4nR2ocvdtwyEFZ8-B9ERhZDWrPGtO81aeG-uyK-SmptCEJhaeTVa1qK_DsAA22qExjcZfZbBUgzgg_fk72pcbGK3hKx0HM4CjE6gV7rkDVW4HVSsKp6HVN9lR0p9vf236G0xGb1zNva1t/s400/ex.JPG)
Give the Server name and login credentials :
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVBbZcOg1jgvYp0IDtoeRaXekLENYJGMy-H5j334PduiEPDL8v3hU8B-2kWgggqC1L-0oC4nKvUTW-SyTJwZEVK6cV4n6FI0Yg2FxIjjQlD7irATyOx_VZ-A_9bdI5MaCSZLC8MM7HiZsq/s400/ex1.JPG)
Select the Database and Table/View from which you want to pull data .
Give the file name and click on Finish .
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYjolGFE_c8r-u0S8WdXfJ7CFKvG2N69mWL0Gz3EwVyPWntqX1eyX1V72L6-jk4S4XqgzLLmFQ8BZ60D_vdeU48CRjo0dABhGzBcHBNBYIebK6s4RsuwwXuU_cVTDwyMi4_uLvxTn7UB4R/s320/ex3.JPG)
Again you will be prompted for Table / View from which you want to pull data .
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWPjeh0Qo2INztesg12o8zjt4MWCyB-PuZg7mESAAZkJhjbZvT_Z1k5r_hvihktV6eg4rACLk1D6YX0LHcl0rmnhNFsqujYO-q9bEUkFZMVN0ZtLLcdk5fjED2V7mYPzMQxaD2WfpRzHlA/s320/ex4.JPG)
Select the type in which you want to view the retrieved data and then click on Properties ...
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNsDMq4RMm6hnz8EWdCmKp_L7gN5CZ7ohIdLMMhXEbV16zG_a11uGI9art9QQ16ZEFycefBw6epwIZj1ypYL0GCpcsXUaOXU6Kh6wbvKWHXh60tsZrWl6neP8EzQxkaxaCf4Dg858pWv2j/s1600/ex5.JPG)
Under Usage pane - > select the refresh options to update the data in the excel sheet whenever data gets updated in the database .
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlalFWpxyuBRr_Rt35tEOGhkWYcAlRsBMDNlxXC3naAZmUcZXkdexNGpioPRFoy2065L_naMqdThNFOvSy9o9IKj-xUZvoF3wFtmulERVTE8QdZzSpMGLL__hbSPpGwQdbA291v4YkKRGk/s320/ex6.JPG)
Under Definition pane - > If you want to pull data from T-SQL query or by executing
Stored procedure - > select the Command type as SQL and place the query in the Command text .
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho05avauBZ3bLvpCJm-jnqpb1xZYdlYfcutX3eN0DWoEGMUgN3MhEi7MNQbA4abmx6OsHO98TaOqsYiLdJrbErKsstXGMX-CtyUn3hE-QWtVJYgAlWlH6uVFw_3dGt3CAnBcv3vb7ahSmL/s320/ex7.JPG)
If you click OK , you can notice data getting populated as shown below :
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDUxeWnllsogQC8vQOIPZ7viztP5WmQ86sP-eF3pbsoc2vEemCd60EeZYS-C2PBpWsNhG35ikB2GzCw-OrWlxpHS3H9ZPRHS4uyXosoovsqzaKGu2JOi0A2APip1-f2ihQ18tRp6n12Qbz/s320/ex8.JPG)
Open Excel - > Under Data tab - > From Other Sources - > click the drop-down - > click on From SQL Server .
Give the Server name and login credentials :
Select the Database and Table/View from which you want to pull data .
Give the file name and click on Finish .
Again you will be prompted for Table / View from which you want to pull data .
Select the type in which you want to view the retrieved data and then click on Properties ...
Under Usage pane - > select the refresh options to update the data in the excel sheet whenever data gets updated in the database .
Under Definition pane - > If you want to pull data from T-SQL query or by executing
Stored procedure - > select the Command type as SQL and place the query in the Command text .
If you click OK , you can notice data getting populated as shown below :
No comments:
Post a Comment