Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

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

$
0
0

I have a procedure that uses a user defined table type.
I am trying to redeclare the @accountList parameter into a local

variable but it's not working and says that i must declare the

scalar variable @accountList.

this is the line that is having the issue: must declare the

scalar variable @accountList

SET @local_accountList = @accountList

ALTER PROCEDURE [dbo].[sp_DynamicNumberVisits] @accountList AS 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) SET @local_accountList = @accountList SET @local_startDate = @startDate SET @local_endDate = @endDate ------------------------------------------------------- CREATE TYPE [dbo].[integer_list_tbltype] AS TABLE( [n] [int] NOT NULL, PRIMARY KEY CLUSTERED ( [n] ASC )WITH (IGNORE_DUP_KEY = OFF) ) GO




Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>