DECLARE @Companies_List char(25)
SET @Companies_List = ('Amazon','Google','Facebook')
select *
from companies
where name in @Companies_List
I'm new to SQL Server. I'm trying to create a global set containing the values that I want to use in the SQL where clause, but apparently the above script wouldn't work. Any idea how I should do it? Many thanks!
char(25). I would recommend usingvarchar(25)instead.