troubleshooting Question

vbscript - getting a recordset back from a stored procedure

Avatar of ieg
iegFlag for United Kingdom of Great Britain and Northern Ireland asked on
VB Script
3 Comments1 Solution6248 ViewsLast Modified:
Hi
Can anyone advise how best to get a recordset back from a stored procedure using VBScript?
I need to pass a stock code as an input parameter and I'd like to get a recordset that I can then iterate over and process in my vbscript.

I want to pass the start of the stock code to the stored procedure (e.g. B1%) and get a list back.

My test stored procedure looks like this.
ALTER PROCEDURE [dbo].[ALtest]
      -- Add the parameters for the stored procedure here
      @p_StockCode varchar(50)
      
AS
BEGIN
      -- SET NOCOUNT ON added to prevent extra result sets from
      -- interfering with SELECT statements.
      SET NOCOUNT ON;

    -- Insert statements for procedure here
      SELECT StockCode, Description from InvMaster where StockCode like @p_StockCode
END


Many thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros