Command: SQL Proc 101
SQL Proc help
I need help accessing SQL Proc results, I've done some searching but no
comprehensive detailed tutorial anywhere. If there's 1 it's for older versions of DW.
What I have:
SQL2005
DWCS4
ASP
I can connect to SQL2005 via ODBC
I can create SQL queries, recordsets and get the result in a page
I can create a form, submit form and return a recordset
I know the basic stuff
Now on to the next challenge:
I have a SQL procedure that if table A exists it drops it,
runs a query,populates the result in table A
then presents it in a result
Now, I need to translate this to DW using Command: SQL Procedure
--------------------------------------------------------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[NewProductsRangedToStores]
AS
BEGIN
SET NOCOUNT ON;
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].
select distinct spr.StoreID,spr.ProductID,p.ProductDescription,
storerangestartdate StartDate,storerangeenddate EndDate
into A
from storeproductrange spr
join product p
on spr.productid=p.productid
where(storerangestartdate between getdate()
and convert(nvarchar,getdate()+21,101))
and spr.ProductID=101304433
order by 2,1
END
-------------------------------------------------------------------------------------
Create a page with input query for ProductID
Submit it and returns a page with the SQL PRoc results
What do I need to do? Documentation for COmmand: SQL Procedures
in Adobe's documentation is limited. The new window in creating
SQL Procedures in DW has new variables, there's no info in the documentation:
Name, Type, Direction, Size, Default Value, Run-Time Value
What do I need to do to send the data to SQL Proc?
Should I change the "spr.productid=10130433" to "spr.productid=mmcolparam"
So, base on my SQL Proc above, what/how do I populate the variables?
what do I need to get the "Return Recordset named", do I name this myself?
do I create a sep recordset?
Lots of questions, hoping there's some easier way documentation somewhere.
I have done some searching on this in the forum, but there's no comprehensive detail
about putting it all together.
thanks in advance!
