XML Stored proc argument

  • How can I tell if an XML input argument to a stored proc is actually empty?

    TIA,

    Barkingdog

  • How do you define "empty"?

    XML variable

    a) is NULL

    b) is an empty string

    c) contains nodes without elements

    d) contains nodes with :nil values



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • See if this helps

    DECLARE @x XML

    SET @x=NULL

    SELECT @x.exist('/*')

    SET @x=''

    SELECT @x.exist('/*')

    SET @x='<Root/>'

    SELECT @x.exist('/*')

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537
  • Thank you Mark.... good ideas... let me toy with them.

    Barkingdog

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply