You do not require a dynamic query for such case, you can use below simple query to get the desired result.
declare @Searchkey varchar(50)= 'a'
select * from products where upper(ProductName) like '%' + upper(@Searchkey) + '%'
If you still want to go with Dynamic query then below are the connect syntax.
declare @Searchkey varchar(50)='a'
declare @Sql nvarchar(max) =''
set @Sql =@Sql+'select * from products where upper(ProductName) like ''%' +upper(@Searchkey)+'%'''
--print @Sql
execute sp_executesql @Sql
Note: Whenever you will get an error with a dynamic query then the best way is to print the query using print statement that will help to identify the error easily. In your case, a single quote was missing.