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..
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=?"