Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

How can I tell if an XML block is 'empty'

$
0
0
How can I tell if an XML block is 'empty'
XML
How can I tell if an XML block is 'empty'
12/13/2011
01:32:56 PM
3DS0T1G7A Show this entire thread in new window
From:
To:
All
Attachments:
None
Is there a quick way to do this? If I receive an 'empty' XML fragment eg <Candidates></Candidates> - return, or else process the data inside.
Logic vastly reduced - so what I'm asking for is a quick way to see if XML = '<Candidates></Candidates>' in a SQL stored PROC.

Thanks,
Doug

CREATE PROCEDURE [dbo].[Receive_XML] ( @CandidateXML XML ) AS BEGIN SET NOCOUNT ON; IF NULLIF( CAST( @CandidateXML AS NVARCHAR), N'<Candidates></Candidates>' ) IS NOT NULL BEGIN -- Do Processing END ELSE BEGIN -- Return - nothing to process END END




Viewing all articles
Browse latest Browse all 10393

Trending Articles