Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Select ID,AddressLine1,PostCode,Price,Name from Property
- <Property>
- <ID> 1 <ID>
- <Address>
- <Line1>10 Downing Street</Line1>
- <PostCode>SW11SW</Postcode>
- </Address>
- <Price> 1,000,000,000 <Price>
- <Name> My Next House<Name>
- </Property>
- DECLARE @Property TABLE (ID INT, [AddressLine1] VARCHAR(30), PostCode VARCHAR(7),
- Price MONEY, [Name] VARCHAR(20));
- INSERT @Property
- SELECT 1,'10 Downing Street','SW11SW',1000000000,'My Next House'
- SELECT ID, AddressLine1 AS 'Address/AddressLine1', PostCode AS 'Address/Postcode',
- Price, Name
- FROM @Property
- FOR XML PATH('Property'), ELEMENTS
- Select
- ID,
- AddressLine1 as 'Address/Line1',
- PostCode as 'Address/Postcode',
- Price,
- Name
- from Property
- for xml path, elements
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement