This is how variables are declared:
CREATE FUNCTION Fn_custom_roomie_emails
(@htenant NUMERIC(18),
@dtmoveout DATETIME,
@lesseeonly VARCHAR(3)= 'NO',
@relationship VARCHAR(100),
@listseparator VARCHAR(10) = '; ',
@nameseperator VARCHAR(10) = ', ',
@andfunction VARCHAR(3) = 'NO',
@tenantemail VARCHAR(100) = '')
The function works fine when I execute in this way:
exec dbo.Fn_custom_roomie_emails(hmy, Getdate(), 'All', **'Roommate'**, ';', ' ', '', 'YES')
But now I want to pass multiple relationships as shown below:
exec dbo.Fn_custom_roomie_emails(hmy, Getdate(), 'All', **'Roommate', 'Guarantor'**, ';', ' ', '', 'YES')
So how can I do that?