create function fnSkrati (@String nvarchar(max))
returns nvarchar (10) 
as
begin
	return case 
	when len (@String) <= 10 then @String
	else substring (@String, 1, 7) + '...'
	end
end

print dbo.fnSkrati ('Zvonko')
print dbo.fnSkrati ('Zvonimire')

select Naziv, dbo.fnSkrati(Naziv) as NazivSkraceni from Proizvod