As a noob to stored procedures, I can't get my head around how to get a classic ASP (vbscript) page to return a value from a stored procedure. I can write data to a table ok, it's just retrieving stuff that has me stuck.
If I use a very basic example. This is a stored procedure that should return a count of the records in a table:
CREATE PROCEDURE [dbo].[SP_RecordCount]
AS
SELECT COUNT(*) FROM MyTable
What Classic ASP code (and what changes to the SPROC) would I need to write to be able to display the value in a browser?
Once I understand how to get a basic output such as this, I should hopefully(!) be able to build on the knowledge.
Thanks.
Best Answer
Probably the cleanest way is to modify your stored procedure like this:
... and this is the server-side code to call it and read the value: