Salut,
va rog imi poate spune cineva cum as putea prinde o eroare de conversie intoarsa de functia CAST intr-o functie fara sa folosesc TRY CATCH. Incerc sa fie compatibila si cu SQL Server 2000 si cu 2005. Lucrez pe un 2005.
Uitati ce am incercat :)
DECLARE @x AS VARCHAR(50)
....
SELECT @y = CAST(@x AS BIGINT)
IF @@ERROR <> 0
BEGIN
SET @eroare = 'eroare la conversie'
RETURN
END
MCP (C Sharp)
Software Engineer,
Cluj Napoca