Yes, it runs successfully. I can run it from Visual Studio and SQL Server MS and get the correct result set.
Here is the code:
ALTER PROCEDURE [dbo].[App_ReportFormValues]
(
@PortalType int = 2
)
AS
BEGIN
/*
This SPROC creates and fills a table that will be used to hold the report values that are
created by ReportingFields_GridView.ascx
*/
SET NOCOUNT ON
create table #ReportFormValues (colID int, colName nchar(20), colOrd int, sortOrd int, operator char(5),
compare1 nvarchar(50), compare2 nvarchar(50), datatype char(10),
hasrange bit, retmulti bit, fromexp varchar(200), fielddef varchar(200))
/* Prime table with metadata */
insert into #ReportFormValues (colID, colName, datatype, hasrange, retmulti, fromexp, fielddef)
select colid, colName, datatype, hasrange, retmulti, fromexp, fielddef
from App_ReportingFields where portaltype = @PortalType
select * from #ReportFormValues
END
Should be a retrieval type procedure to me!
Thanks
Harold