create table #T (ID int identity primary key,XMLCol XML);
insert into #T (XMLCol)select ' ';
insert into #T (XMLCol)select '';
insert into #Tdefault values;
select *from #Twhere XMLCol is not null and cast(XMLCol as varchar(max)) != '';
DECLARE @var XMLSET @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