All,
I admit, I use stored procedures normally for updates, inserts and deletes. My skills and reference material is basic. I don't expect an answer, but if you can point me to online resources I would appreciate it. I haven't refined my search enough appearently cause I haven't found on this site yet.
I am creating a stored procedure that takes two input fields and then returns 5 fields from 2 tables along with a row counter back to an ASP page. Not used to working with output back to ASP and am not an ASP coder by trade.
Do I have to define all the fields as output since I am attaching a rownumber field and assign them or do I just increment the rownumber field?
CREATE PROCEDURE dbo.spMergProductsPrices
@category VARCHAR(50),
@subcategory VARCHAR(50),
@rownumber INT OUTPUT
AS
SELECT dbo.epp_products.product_name, dbo.epp_products.product_id, dbo.epp_products.description, dbo.epp_products.category,
dbo.epp_products.subcategory, dbo.epp_store_price.product_size, dbo.epp_store_price.regular_price
FROM dbo.epp_products INNER JOIN
dbo.epp_store_price ON dbo.epp_products.product_id = dbo.epp_store_price.product_id
WHERE (dbo.epp_products.category = @category) AND (dbo.epp_products.subcategory = @subcategory)
GO
I admit, I use stored procedures normally for updates, inserts and deletes. My skills and reference material is basic. I don't expect an answer, but if you can point me to online resources I would appreciate it. I haven't refined my search enough appearently cause I haven't found on this site yet.
I am creating a stored procedure that takes two input fields and then returns 5 fields from 2 tables along with a row counter back to an ASP page. Not used to working with output back to ASP and am not an ASP coder by trade.
Do I have to define all the fields as output since I am attaching a rownumber field and assign them or do I just increment the rownumber field?
CREATE PROCEDURE dbo.spMergProductsPrices
@category VARCHAR(50),
@subcategory VARCHAR(50),
@rownumber INT OUTPUT
AS
SELECT dbo.epp_products.product_name, dbo.epp_products.product_id, dbo.epp_products.description, dbo.epp_products.category,
dbo.epp_products.subcategory, dbo.epp_store_price.product_size, dbo.epp_store_price.regular_price
FROM dbo.epp_products INNER JOIN
dbo.epp_store_price ON dbo.epp_products.product_id = dbo.epp_store_price.product_id
WHERE (dbo.epp_products.category = @category) AND (dbo.epp_products.subcategory = @subcategory)
GO