Home Forums SQL Server 7,2000 Globalization How can I check if and xml Field is not null or blank in sql sever RE: How can I check if and xml Field is not null or blank in sql sever

  • I think you may have posted in the wrong forum as this is a 2000 forum, but you should try this:

    DECLARE @var XML

    SET @var = '' -- '<test>test</test>'

    SELECT @var.exist('/test')

    IF @var IS NOT NULL AND @var.exist('/test') = 1

    BEGIN

    SELECT 'not null'

    END

    ELSE

    BEGIN

    SELECT 'null'

    END