Home Forums SQL Server 2005 T-SQL (SS2K5) RAISERROR in TRY/Catch block after XML Schema Collection Validation. RE: RAISERROR in TRY/Catch block after XML Schema Collection Validation.

  • How about this approach?

    DECLARE @EmpXML AS XML(EmployeeSchema)

    DECLARE @LocalError -- as what?

    BEGIN TRY

    SET @EmpXML = @EmployeeXML -- TRY to set the @EmpXML to @EmployeeXML

    END Try

    BEGIN CATCH

    -- If the attempt fails, then

    SET @LocalError = 50001 --user defined error

    RAISERROR(' The input parameter @EmployeeXML is not valid', 16, 1)

    END

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills