I can figure out how to pass a table parameter to a sProc. Here's my current code and results.
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'spMetaPageWrite'
AND type = 'P')
DROP PROCEDURE spMetaPageWrite
GO
------------------ spMetaPageWrite ----------------------
CREATE PROCEDURE spMetaPageWrite
@par_uSection uniqueidentifier,
@par_sPage varchar(40),
@par_tRows table
(TXT_Property varchar(50),
TXT_Language char(2),
TXT_Value nvarchar(4000)),
@par_sFriendlyName nvarchar(4000)=NULL,
@par_bLocal bit=0
WITH RECOMPILE
AS
-- DECLARE @uGlobal uniqueidentifier
-- SET @uGlobal = CAST(CAST('GLOBAL' AS binary(32)) AS uniqueidentifier)
-- More will go here
SELECT * FROM @par_tRows
GO
------------------------
RESULTS:
Server: Msg 156, Level 15, State 1, Procedure spMetaPageWrite, Line 7
Incorrect syntax near the keyword 'table'.
Server: Msg 137, Level 15, State 1, Procedure spMetaPageWrite, Line 51
Must declare the variable '@par_tRows'.
I am trying to pass a data table from asp.net to an sProc/UDF. How could it be done if not via a parameter? Should asp.net create a global temp table (can it?) and my sProc work with it?