Click here to Skip to main content
15,893,161 members
Home / Discussions / Database
   

Database

 
QuestionNumeric Issue Pin
Darkness846-Mar-07 19:13
Darkness846-Mar-07 19:13 
AnswerRe: Numeric Issue Pin
Colin Angus Mackay6-Mar-07 21:34
Colin Angus Mackay6-Mar-07 21:34 
GeneralRe: Numeric Issue Pin
Darkness847-Mar-07 1:58
Darkness847-Mar-07 1:58 
GeneralRe: Numeric Issue Pin
Dave Kreskowiak7-Mar-07 8:12
mveDave Kreskowiak7-Mar-07 8:12 
QuestionEmail subscription permission denied on SSRS 2000 Pin
bubberz6-Mar-07 11:10
bubberz6-Mar-07 11:10 
Questionprepared statment Pin
jds12076-Mar-07 10:17
jds12076-Mar-07 10:17 
AnswerRe: prepared statment Pin
Mark J. Miller7-Mar-07 6:13
Mark J. Miller7-Mar-07 6:13 
QuestionSQL For XML Query [modified] Pin
GaryWoodfine 6-Mar-07 5:53
professionalGaryWoodfine 6-Mar-07 5:53 
Hi Guys I need help with writing the following query

The Query
Select  daydesc as description ,Features,<br>        adfull, askprice,   bedrooms as bedroom,rooms,<br>	floorarea as sqm, (pADDRESS1 + ''+  PADDRESS2+ ''+PADDRESS2+         ''+PADDRESS3+ ''+ PADDRESS4) AS ADDRESS  ,directions <br>		<br>from  dbo.PROPERTY as Property<br>	where property_id = @id 	for xml auto,elements


Which Currently returns this
< Property><br>  <description>Space and comfort set the tone of this stylish four bedroomed dormer bungalow on the Moynalty Road just outside the village of Mullagh. Situated just short stroll into Mullagh village and all it's amenities, this proeprty offers a purchaser a spacious family home with open-plan kitchen, dining and living areas. Althrough deceptive from the outside, this property is surprisingly spacious and well-laid out with three bedrooms (one en-suite) and family bathroom on the first floor and a very useful double bedroom with adjacent guest w.c, large sitting room, kitchen/dining, separate living/dining and utility room on the ground floor. Viewing by appointment with the Auctioneers is highly recommended.</description><br>  <features>Deceptively spacious family home		<br>Quality cream fitted kitchen			<br>Two fine reception rooms 			<br>Slate-tiled kitchen/dining room			<br>Television points in all rooms			<br>Just a short stroll or minutes drive from the village of Mullagh		<br>Close to local Primary School<br>Close to shops, school, church, hotel, playgroup etc.<br>On bus route to secondary schools</features><br>  <askprice>3.7000000e+005</askprice><br>  <bedroom>4</bedroom><br>  <rooms>Entrance Hall (5.38m x 1.78m)<br>Guest W.C. (2.39m x 1.40m)<br>Bedroom (4.35m x 2.51m)<br>Sitting Room (5.98m x 3.62m)<br>Kitchen/Dining Room (8.22m x 3.68m)<br>Utility Room (2.84m x 2.42m)<br>Dining/Living Room (5.38m x 2.84m)<br>Landing ()<br>Bedroom (5.16m x 2.38m)<br>En-Suite Shower Room (1.92m x 1.87m)<br>Bedroom (4.91m x 2.83m)<br>Bedroom (4.17m x 2.88m)<br>Family Bathroom (3.44m x 2.19m)<br></rooms><br>  <sqm>166</sqm><br>  <directions>From Kells, travel about 4.5  miles into Moynalty village, taking left at the RC church and travel almost two miles.  The property is just outside the village of Mullagh on the right hand side.</directions><br></Property>

It works as expected However, what I would like to achieve is that within the Features field, which is held as a text field in the db, contains the features separated by carriage return statements. I would like to extract features XML so that it looks like

<Features><br><feature>blah</feature><br><feature>blah blah</feature><br></Features>

Is this possible ?
I thought about using something like
CHARINDEX(features,CHAR(13)+CHAR(10))as feature
But a little unsure of how to make it work? Any tips welcome




Kind Regards,
Gary


My Website || My Blog || My Articles

AnswerRe: SQL For XML Query Pin
Colin Angus Mackay6-Mar-07 21:30
Colin Angus Mackay6-Mar-07 21:30 
GeneralRe: SQL For XML Query Pin
GaryWoodfine 6-Mar-07 22:36
professionalGaryWoodfine 6-Mar-07 22:36 
GeneralRe: SQL For XML Query Pin
Colin Angus Mackay7-Mar-07 10:00
Colin Angus Mackay7-Mar-07 10:00 
GeneralRe: SQL For XML Query Pin
GaryWoodfine 6-Mar-07 23:20
professionalGaryWoodfine 6-Mar-07 23:20 
GeneralRe: SQL For XML Query Pin
Colin Angus Mackay7-Mar-07 10:01
Colin Angus Mackay7-Mar-07 10:01 
Questionopening ado recordset for update is very very slow Pin
gritter6-Mar-07 5:16
gritter6-Mar-07 5:16 
AnswerRe: opening ado recordset for update is very very slow Pin
andyharman6-Mar-07 6:52
professionalandyharman6-Mar-07 6:52 
GeneralRe: opening ado recordset for update is very very slow Pin
gritter6-Mar-07 7:31
gritter6-Mar-07 7:31 
QuestionDataBase BackUp And Restore Remote Server Pin
Gali yugan6-Mar-07 3:11
Gali yugan6-Mar-07 3:11 
AnswerRe: DataBase BackUp And Restore Remote Server Pin
Mark J. Miller7-Mar-07 6:23
Mark J. Miller7-Mar-07 6:23 
QuestionHow to find foreign key for a given table in sql server 2005 Pin
NK76-Mar-07 1:11
NK76-Mar-07 1:11 
AnswerRe: How to find foreign key for a given table in sql server 2005 Pin
Pete O'Hanlon6-Mar-07 1:24
mvePete O'Hanlon6-Mar-07 1:24 
GeneralRe: How to find foreign key for a given table in sql server 2005 Pin
NK76-Mar-07 1:39
NK76-Mar-07 1:39 
QuestionRAISERROR Pin
topcatalpha6-Mar-07 0:12
topcatalpha6-Mar-07 0:12 
AnswerRe: RAISERROR Pin
Pete O'Hanlon6-Mar-07 1:20
mvePete O'Hanlon6-Mar-07 1:20 
GeneralRe: RAISERROR Pin
topcatalpha6-Mar-07 5:19
topcatalpha6-Mar-07 5:19 
Questionto connect an access database in vb.net windows based Pin
roma_sayed5-Mar-07 22:50
roma_sayed5-Mar-07 22:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.