Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 Passing Parameters to excel Data Connection query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

4 Posts

Posted - 02/12/2013 :  04:48:09  Show Profile  Reply with Quote

I'm pulling data into excel from SQL Server 2008 using excel 2010 Data Connections.

I have a dynamic query for which the parameters have to be passed to the query.

Please let me know how to do this.

Thanks in Advance.

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 02/12/2013 :  05:10:23  Show Profile  Reply with Quote

SQL Server MVP

Go to Top of Page

Starting Member

4 Posts

Posted - 02/12/2013 :  05:41:25  Show Profile  Reply with Quote
Thanks for your reply. But i have multiple parameters to be passed.
I have created a stored procedure. when i run the SP in SSMS by passing parameters i'm getting the reqiured result set. i want to pass the same parameters in my excel to that SP or to the query so i can get the same result set in my excel excel should ask for the parameter like how when i execute my SP..
Go to Top of Page

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 02/12/2013 :  08:48:11  Show Profile  Reply with Quote
Both of those requirements - multiple parameters and having the query prompt you for parameters - can be accomplished via the method described in that article. For multiple parameters, you simply repeat the process you go through for one parameter. For getting prompting for parameter values, simply do not provide a cell from which to pick up the value. Experiment with it exactly the way they are showing in that article, then try to change it and you will see that it is possible.

To use a stored proc, use syntax like "EXEC StoredProcName @param1=?, @param2=?"
Go to Top of Page

Starting Member

4 Posts

Posted - 02/13/2013 :  05:16:44  Show Profile  Reply with Quote
Thank You!! Its working
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000