Erro: [Microsoft][SQL Server Native Client 10.0]TCP Provider: The semaphore timeout period has expired.
DECLARE @curpos GEOGRAPHY = GEOGRAPHY::STPointFromText('POINT(-53.274000000000001 -26.823)',4326); SELECT DISTINCT ISNULL(cid_nome+' (distrito de '+cid_distritode+') ',cid_nome)+' - '+cid_uf AS aer_cid_nome, cid_id AS aer_cid_id, loc_gps.STDistance(@curpos)/1000.0 AS [KM], loc_id AS aer_loc_id, loc_nome AS aer_loc_nome FROM sys_locais INNER JOIN sys_locais_atrib ON sys_locais.loc_id = sys_locais_atrib.latr_loc_id INNER JOIN sys_cidades ON sys_locais_atrib.latr_atr_vlr = sys_cidades.cid_id WHERE sys_locais.loc_tp_id = 5 AND sys_locais_atrib.latr_atr_id = 39 AND loc_gps.STDistance(@curpos) / 1000.0 <= 200 AND loc_nome NOT LIKE '% (em %' ORDER BY [KM]