In t-sql-2012, I am trying to load all the schoolID values into the variable called @CalendarID.
I then want to pass all the values into a parameter called @schoolID into a stored procedure called procCalendarS.
The dbo.fn_splitString is a string split function at my company where you can split a string of values.
The parameter going into the stored procedure called schoolid is declared as nvarchar(max).
Here is the sql.
declare @calendarID VARCHAR (8000) = (SELECT schoolID from dbo.school)
DECLARE @return_value int
EXEC @return_value = campusOPS.[dbo].[procCalendarS]
@schoolID = SELECT * FROM dbo.fn_splitString(@CalendarID),
@endYear = N'2019'
SELECT 'Return Value' = @return_value
can you show me how to pass all the values called schoolid from the school table into the @schoolID paramter?