Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @xmltbl TABLE (ID INT, XmlData XML)
- INSERT INTO @xmltbl(ID, XmlData)
- VALUES((select Id from News where sId=129),(select content from News where sId=129));
- ;WITH XMLNAMESPACES (DEFAULT 'http:microsoft.com')
- SELECT ID, C.value('(.)[1]', 'varchar(1000)') DataText FROM @xmltbl
- CROSS APPLY
- XmlData.nodes('/BreezyCalc/Graph/point') n (C)
- select DataText from @xmltbl
- if (DataText ="")
- BEGIN
- INSERT INTO @xmltbl(ID, XmlData)
- VALUES((select Id from News where sId=129),(select content from News where sId=129));
- ;WITH XMLNAMESPACES (DEFAULT 'http://schemas.microsoft.com/winfx/2006/xaml/presentation')
- SELECT ID, C.value('(.)[1]', 'varchar(1000)') DataText FROM @xmltbl
- CROSS APPLY
- XmlData.nodes('BreezyCalc/Graph/point/@Text') n (C)
- select DataText from @xmltbl
- END
- ID DataText
- -------------------
- 129 |lines added
- DECLARE @Datatext as varchar(200)=''
- ,IDParameter as Int = 129
- SET @Datatext= (select top 1 XMLData from @xmltbl where ID=@IDParameter)
- if ISNULL(@DataText,'') =''
- BEGIN
- some code here
- END
- ELSE IF (Some Other Condition)
- BEGIN
- some code here
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement