I have a select query
select *
from dbo.GetTableFromString ('2,www.google.com')
which returns this result:
2
www.google.com
Edit from comments: Function accepts comma separated values and returns a single column called name.
Now I want to store 2 in variable called @ID and www.google.com in @Link.
What is the best way to achieve this?
declare @id int,@link varchar(200) ;with cte as ( select * from dbo.GetTableFromString ('2,www.google.com') ) select @id=id,@link=link from cte