Welcome to Sign in | Help

Functia CAST

  •  11-27-2007, 2:24 PM

    Functia CAST

    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
    Filed under: ,
View Complete Thread
Powered by Community Server (Commercial Edition), by Telligent Systems