troubleshooting Question

Classic ASP returning a value from a SQl Server Stored procedure into VBScript variable

Avatar of splanton
splantonFlag for United Kingdom of Great Britain and Northern Ireland asked on
Microsoft SQL ServerVisual Basic ClassicASP
2 Comments1 Solution885 ViewsLast Modified:
I have a SQL Server 2008 Stored procedure that looks like this:

create procedure [dbo].[usp_NewOrderReference]
(@NewOrderReference Char(10) OUTPUT)
AS

BEGIN
	
	SET @NewOrderReference = (SELECT 'ORD' + RIGHT ('0000000' + CAST(OrderNumber AS VARCHAR (10)),7) FROM [OrderReference])
	
	UPDATE OrderReference Set OrderNumber = (OrderNumber +1)
	
END

I am trying to call the Stored procedure from ASP like this:

<%
	SQLStmt = "exec.dbo.usp_NewOrderReference '';"
	Set RS_Result01 = Connection01.Execute(SQLStmt)

%>

It runs just fine (as you would expect).

The question is: How do i get the resulting NewOrderReference back into a VBScript variable for use on the page?
ASKER CERTIFIED SOLUTION
Big Monty
Web Ninja at large

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
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 2 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