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

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

shalz.leo
Starting Member

4 Posts

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

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.

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

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

http://superuser.com/questions/197453/run-an-sql-query-with-a-parameter-from-excel-2007

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

shalz.leo
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 also.my 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

3593 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

shalz.leo
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  
 New 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