Click here to Skip to main content
15,899,026 members
Home / Discussions / Database
   

Database

 
QuestionSetting default value to a column Pin
M. J. Jaya Chitra18-Jun-07 20:01
M. J. Jaya Chitra18-Jun-07 20:01 
AnswerRe: Setting default value to a column Pin
Sylvester george18-Jun-07 20:10
Sylvester george18-Jun-07 20:10 
GeneralRe: Setting default value to a column Pin
M. J. Jaya Chitra18-Jun-07 20:20
M. J. Jaya Chitra18-Jun-07 20:20 
GeneralRe: Setting default value to a column Pin
Sylvester george18-Jun-07 20:25
Sylvester george18-Jun-07 20:25 
GeneralDeleting two tables on different databases located in different servers Pin
N a v a n e e t h18-Jun-07 18:22
N a v a n e e t h18-Jun-07 18:22 
GeneralRe: Deleting two tables on different databases located in different servers Pin
vimal_yet18-Jun-07 19:13
vimal_yet18-Jun-07 19:13 
GeneralRe: Deleting two tables on different databases located in different servers Pin
N a v a n e e t h18-Jun-07 19:32
N a v a n e e t h18-Jun-07 19:32 
GeneralRe: Deleting two tables on different databases located in different servers Pin
vimal_yet18-Jun-07 21:22
vimal_yet18-Jun-07 21:22 
Questionpass the values Pin
seemamltn18-Jun-07 13:17
seemamltn18-Jun-07 13:17 
AnswerRe: pass the values Pin
Colin Angus Mackay18-Jun-07 13:27
Colin Angus Mackay18-Jun-07 13:27 
GeneralRe: pass the values Pin
seemamltn18-Jun-07 13:32
seemamltn18-Jun-07 13:32 
GeneralRe: pass the values Pin
Colin Angus Mackay18-Jun-07 14:26
Colin Angus Mackay18-Jun-07 14:26 
QuestionReturn Value from Stored Procedure Pin
seemamltn18-Jun-07 9:47
seemamltn18-Jun-07 9:47 
AnswerRe: Return Value from Stored Procedure Pin
Colin Angus Mackay18-Jun-07 13:18
Colin Angus Mackay18-Jun-07 13:18 
QuestionError message Pin
seemamltn18-Jun-07 9:43
seemamltn18-Jun-07 9:43 
AnswerRe: Error message Pin
andyharman19-Jun-07 7:23
professionalandyharman19-Jun-07 7:23 
QuestionStored Proc Pin
seemamltn18-Jun-07 8:51
seemamltn18-Jun-07 8:51 
AnswerRe: Stored Proc Pin
Colin Angus Mackay18-Jun-07 9:22
Colin Angus Mackay18-Jun-07 9:22 
GeneralRe: Stored Proc Pin
seemamltn18-Jun-07 9:43
seemamltn18-Jun-07 9:43 
GeneralRe: Stored Proc Pin
Colin Angus Mackay18-Jun-07 13:10
Colin Angus Mackay18-Jun-07 13:10 
QuestionSet Time Part Of DateTime Pin
Polymorpher18-Jun-07 7:41
Polymorpher18-Jun-07 7:41 
QuestionCDATA Sections in For XML query Pin
GaryWoodfine 18-Jun-07 6:28
professionalGaryWoodfine 18-Jun-07 6:28 
Hi Guys,

I have a stored proc that is returning XML to the client, as listed below.
The question I have is that the description field can contain some HTMLa and possibly some illegal XML characters i.e &,<,>, ' etc.
I would like to wrap these sections in a CDATA field but am a little unsure how to do it.

Oh yeah the XML is going to be transformed by XSLT on the client.

Any tips would be greatly appreciated.
Ideally what I would like to achieve is to get rid of calling my DBO.HTMLENcode function I have written to encode the illegal characters.
Select @Brief as briefdescription,<br />
Cast('' + replace(cast(DBO.HTMLENcode(@Desc) as varchar(max)) , char(13),'' ) + '' as xml) as descriptions ,<br />
cast('' + replace(cast(DBO.HTMLENcode(Features) as varchar(max)), char(13)+char(10), '') + '' as xml) AS Features,<br />
cast(price as money) as price, bedrooms as bedroom, status_id,<br />
cast(replace(('' + replace(cast(DBO.HTMLENcode(rooms) as varchar(max)), char(13), '')+ ''),'','') as xml) as rooms,<br />
Size_metre_sq as sqm,<br />
COALESCE (ADDRESS1 + ', ', '') + COALESCE (ADDRESS2 + ', ', '') + COALESCE (ADDRESS3 + ', ',<br />
'') + COALESCE (ADDRESS4, '') AS Address ,directions ,<br />
Saleterms.SALETERMS as saleterm ,Saleterms.price_label as PriceLabel, leaseterms, rating,<br />
<br />
Convert(varchar(11) ,Availability, 113) as availability<br />
<br />
from dbo.PROPERTY as Property<br />
inner join Saleterms on Property.Saleterms_ID = Saleterms.ID<br />
where Property.id = @id<br />
FOR XML PATH('Property'), ROOT('Detail') 




Kind Regards,
Gary


My Website || My Blog || My Articles

QuestionDatabase documentation tool recommendations? Pin
Max Stayner18-Jun-07 4:55
Max Stayner18-Jun-07 4:55 
QuestionQuery sql datatype Sql server 2005 [modified] Pin
Chazzysb18-Jun-07 4:31
Chazzysb18-Jun-07 4:31 
QuestionGet Value Pin
Navneet Hegde18-Jun-07 0:24
Navneet Hegde18-Jun-07 0:24 

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.