The following SQL Server stored procedure example returns data from the "test" table.
CREATE PROCEDURE [dbo].[test_proc]
AS
BEGIN
SET NOCOUNT ON;
SELECT * from test
END
1. Add the test table or any other table to the project.
2. Add the following code to the List page: CustomQuery event:
return DB::Query("EXEC test_proc");
3. Add the following code to the List page: FetchRecords event:
return $rs->fetchAssoc();
4. Add the following code to the ListGetRowCount event:
return DBLookup("select count(*) from test");
See also:
•QueryResult object: fetchAssoc()
•How to execute stored procedures