Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "really a nice solution file"
- <Section xml:space="aligned" Paste="False" xmlns="http://schemas.microsoft.com">
- <Para FontSize="11" FontWeight="Normal" FontStyle="Normal" TextAlignment="Left">
- <Data Text="really a nice solution, but i have an other issue that want to create its xml file" />
- </Para>
- </Section>
- <Section xml:space="aligned" Paste="False" xmlns="http://schemas.microsoft.com">
- <Para FontSize="11" FontWeight="Normal" FontStyle="Normal" TextAlignment="Left">
- <Data Text="really a nice solution file" />
- </Para>
- </Section>
- ID Name XMLContent CreatedDate | Modified
- --------|------------|------------------|------------------------|-----------------------------------------
- 1 | CATEGORYID |<Section xml:space="aligned" Paste="False".| |2011-04-05 12:28:15.030 |
- 2 | 114 |<Section xml:space="aligned" Paste="False".|2011-04-05 12:28:15.030 |
- 1 |really a nice solution, but i have an other issue that want to create its xml file|
- 2 |really a nice solution, |
- DECLARE @xmltbl TABLE (ID INT, XmlData XML)
- INSERT INTO @xmltbl(ID, XmlData)
- VALUES(1, '<Section xmlns="http://schemas.microsoft.com">
- <Para FontSize="11" FontWeight="Normal" FontStyle="Normal" TextAlignment="Left">
- <Data Text="really a nice solution, but i have an other issue that want to create its xml file" /></Para></Section>'),
- (2, '<Section xmlns="http://schemas.microsoft.com">
- <Para FontSize="11" FontWeight="Normal" FontStyle="Normal" TextAlignment="Left">
- <Data Text="really a nice solution file" /></Para></Section> ');
- ;WITH XMLNAMESPACES(DEFAULT 'http://schemas.microsoft.com')
- SELECT
- ID,
- DataText = XmlData.value('(/Section/Para/Data/@Text)[1]', 'varchar(200)')
- FROM @xmltbl
- ID DataText
- 1 really a nice solution, but i have an other issue that want to create its xml file
- 2 really a nice solution file
- SELECT TOP 5
- ID, .....
- FROM ......
- ORDER BY
- -- order by DateAdded descending - giving you the most recent 5 rows
- DateAdded DESC
- ;WITH XMLNAMESPACES(DEFAULT 'http://schemas.microsoft.com')
- SELECT TOP 5
- ID,
- XmlContent.value('(/Section/Para/Data/@Text)[1]', 'varchar(200)')
- FROM dbo.YourTableName
- ORDER BY CreatedDate DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement