sdelano
3 years agoNew Contributor II
Passing a custom sql server data type into a stored procedure
Given the below sql server procedure definition excerpt. How would we pass in an array of data into this this datatype as the input parameter of the stored procedure. when passing in a straight array of values we get the following error.
“reason”:
“Expected value in type:BUID_LIST for parameter:@BUIDS, but got value:[(‘U00003601’), (‘U00007346’), (‘U00011341’), (‘U00011468’), (‘U00019947’), (‘U00026075’), (‘U00027687’), (‘U00038315’), (‘U00041258’), (‘U00043454’)] in type:ArrayList.”
/*
type dbo.BUID_LIST as TABLE (
BUID nvarchar(20) not null
);
go
*/
CREATE PROCEDURE [dbo].[UpdateHousingStudents]
– Add the parameters for the stored procedure here
(@BUIDS dbo.BUID_LIST READONLY,
@Results nvarchar(200) OUTPUT)
AS
BEGIN