I'm trying to set varchar variable like this :
DECLARE @var NVARCHAR(40)
set @var = (SELECT name from Tmptable AS name )
I want this variable store value like this :
This returns an error like the one in the title: Subquery returned more than 1 value.
I use this variable in paramter of on function
FROM [dbo].[MyFunction](@var, DEFAULT) AS PARAM
I know we can't put more than value in a variable.I need that Variable represent More Than One Value by split value to ","
Any regard in this regards