Monday, January 20, 2014

How do i declare a user defined table type sproc parameter as a local variable?

I think since both are table type variable you need to do assignment like this



CREATE PROCEDURE [dbo].[sp_DynamicNumberVisits]
@accountList dbo.integer_list_tbltype READONLY
,@startDate NVARCHAR(50)
,@endDate NVARCHAR(50)
AS
BEGIN
DECLARE @local_accountList AS integer_list_tbltype
DECLARE @local_startDate AS NVARCHAR(50)
DECLARE @local_endDate AS NVARCHAR(50)
INSERT @local_accountList
SELECT * FROM @accountList
--SET @local_accountList = @accountList
SET @local_startDate = @startDate
SET @local_endDate = @endDate
....



And its not explicitly specified in BOL




Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment