
/***************************************
* STORED stp_ricercaFullTerminalino
*
* effettua una ricerca full text da terminalino x codice UDC (su cartellini), x nome particolare (AnagParticolari) o posizione (Celle)
*
* Steamware, S.E.L.
* mod: 2010.09.10
*
****************************************/
create PROCEDURE stp_ricercaFullTerminalino
(
	@txtSearch VARCHAR(50)
)
AS

SELECT  'UDC' AS Tipo, UDC AS label, UDC AS valore
FROM    dbo.ElencoCartellini
WHERE	UDC LIKE '%'+@txtSearch+'%'

UNION

SELECT  'Particolare' AS Tipo, Particolare AS label, Particolare AS valore
FROM    RilPro.AnagParticolari
WHERE	Particolare LIKE '%'+@txtSearch+'%'

UNION

SELECT  'Cella' AS Tipo, CodCella AS label, CAST(IdxCella AS NVARCHAR)AS valore
FROM    dbo.Celle
WHERE	CodCella LIKE '%'+@txtSearch+'%'

RETURN
