Home > Archive > MS SQL XML > September 2005 > XML validation in Stored Procedure









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XML validation in Stored Procedure
Support

2005-09-13, 9:24 am

Hello:
Is there a way that I can validate an XML input to a stored procedure from
within. I want to have some error handling but when I "play " with messing
up the xml string I dont get a trapable error

Select @STUFF='bad xml'
EXEC sp_xml_preparedocume
nt @idoc OUTPUT, @stuff
SELECT ERROR = @@ERROR

Thanks


Michael Rys [MSFT]

2005-09-20, 8:24 pm

Are you interested in parse errors or validation errors?

When I run:

declare @idoc int

EXEC sp_xml_preparedocume
nt @idoc OUTPUT, 'bad xml'

SELECT ERROR = @@ERROR

I capture the error 6602, but since it is a fatal error, the process stops.
This is by design for SQL Server 2000.

Best regards

Michael


"Support" < RemoveThis_Support@m
ail.oci.state.ga.us> wrote in message
news:emDdzuGuFHA.2392@tk2msftngp13.phx.gbl...
> Hello:
> Is there a way that I can validate an XML input to a stored procedure from
> within. I want to have some error handling but when I "play " with
> messing up the xml string I dont get a trapable error
>
> Select @STUFF='bad xml'
> EXEC sp_xml_preparedocume
nt @idoc OUTPUT, @stuff
> SELECT ERROR = @@ERROR
>
> Thanks
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com