hmm, well I created a function with your exact code (including the linked server) except obviously using a table that exists in my environment. And couldn't reproduce the problem.so you're saying this is successfull:declare @mid varchar(3)set @mid = '8'declare@v varchar(8000)select @v = ''select @v = @v + Orb.mib_symbol + ', 'from LINKED_SERVER.dbo.company cwhere (c.home_office_symbol = @mid and c.status = 'Active')if len(@v ) > 0select @v = left(@v, len(@v)-1)select @v
But this isn't?select dbo.fn_TESTING('8')Be One with the OptimizerTG