Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Control chars in XML Expand / Collapse
Author
Message
Posted Wednesday, May 19, 2010 9:40 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 11:47 PM
Points: 1,298, Visits: 1,306
Comments posted to this topic are about the item Control chars in XML



See, understand, learn, try, use efficient
© Dr.Plch
Post #924791
Posted Wednesday, May 19, 2010 9:53 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 2:53 PM
Points: 1,676, Visits: 1,744
This is an excellent question, thank you. I thoroughly enjoyed it because I found it to be pretty difficult to answer correctly. I suspect that "most characters illegal" means all except the tab (char(9)), linefeed (char(10), 0xA), carriage return (char(13), 0xD) and the space(char(32) 0x20). I am curious to find out how the results of your

select * from #t for xml auto;

will look in SSMS results window, will definitely do it tomorrow morning.

Oleg
Post #924797
Posted Wednesday, May 19, 2010 11:01 PM


SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, June 25, 2013 12:33 PM
Points: 45, Visits: 211
hello frnds....


wht ever it may be in order to run completely a block of t-sql code it should be syntax error free

i think there is no += operator in database so the code itself is wrong and u cant even think of it running how can you expect us to post answer for it.......

Post #924814
Posted Wednesday, May 19, 2010 11:58 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 11:47 PM
Points: 1,298, Visits: 1,306
Maddy...! (5/19/2010)
hello frnds....


wht ever it may be in order to run completely a block of t-sql code it should be syntax error free

i think there is no += operator in database so the code itself is wrong and u cant even think of it running how can you expect us to post answer for it.......


This code is valid!
+= operator is legal in the current version of SQL Server.
I expect people to answer questions without running code. I know, I'm old enough to be so naive.




See, understand, learn, try, use efficient
© Dr.Plch
Post #924824
Posted Thursday, May 20, 2010 12:58 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 12,206, Visits: 9,168
honza.mf (5/19/2010)
Maddy...! (5/19/2010)
hello frnds....


wht ever it may be in order to run completely a block of t-sql code it should be syntax error free

i think there is no += operator in database so the code itself is wrong and u cant even think of it running how can you expect us to post answer for it.......

This code is valid!
+= operator is legal in the current version of SQL Server.
I expect people to answer questions without running code. I know, I'm old enough to be so naive.


You should specify which environment is used in the question. As a SQL 2005 user, I saw that there would be an error. You even don't have to run the code to see that.

I cannot guess which environment you had in mind.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #924851
Posted Thursday, May 20, 2010 1:01 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, March 12, 2014 3:59 AM
Points: 1,938, Visits: 1,149
Hi,

When I run this it will success fully executed.I changed it @i+=1 to @i=@i+1;
but it will show result as with out using for xml.






after for xml i executed but it opened on SSMS.But i saved it in the form XML.With IE i am unable to open.With for xml it shows in different.Please explain in detail abot this characters.but i understand that this char will return the value of the character.suppose char(65) will return A.but and also 32 is space i think.what are the charcters below 32.The result of sample data as shown below.

<_x0023_t a="�" />
<_x0023_t a="" />
<_x0023_t a="" />
<_x0023_t a="" />
<_x0023_t a="" />
<_x0023_t a="" />
<_x0023_t a="" />


Malleswarareddy
I.T.Analyst
MCITP(70-451)
Post #924853
Posted Thursday, May 20, 2010 1:02 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 11:47 PM
Points: 1,298, Visits: 1,306
da-zero (5/20/2010)

You should specify which environment is used in the question. As a SQL 2005 user, I saw that there would be an error. You even don't have to run the code to see that.

I cannot guess which environment you had in mind.


This one question was on XML. Yes, you are right, the environment was not specified.




See, understand, learn, try, use efficient
© Dr.Plch
Post #924854
Posted Thursday, May 20, 2010 1:08 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 12,206, Visits: 9,168
honza.mf (5/20/2010)
da-zero (5/20/2010)

You should specify which environment is used in the question. As a SQL 2005 user, I saw that there would be an error. You even don't have to run the code to see that.

I cannot guess which environment you had in mind.


This one question was on XML. Yes, you are right, the environment was not specified.


Well, it could have been a trick question




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #924859
Posted Thursday, May 20, 2010 1:12 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 11:47 PM
Points: 1,298, Visits: 1,306
malleswarareddy_m (5/20/2010)
Hi,

after for xml i executed but it opened on SSMS.But i saved it in the form XML.With IE i am unable to open.With for xml it shows in different.Please explain in detail abot this characters.but i understand that this char will return the value of the character.suppose char(65) will return A.but and also 32 is space i think.what are the charcters below 32.




The characters below 32 are control characters. Once upon a time they were used to control devices like terminals or printers. Today only some are used regularly (tab, new line, line feed, esc...), others are used for special purposes.
Special position is the very first character char(0): it's typically used as a string terminator in C family languages and many other environments. Always take great care using this special one char.
There is at least one other control character: it's backspace (char (127)).

WITH XML clause is used to turn standard query output in form of XML. It has several forms - see books online.




See, understand, learn, try, use efficient
© Dr.Plch
Post #924860
Posted Thursday, May 20, 2010 1:15 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 11:47 PM
Points: 1,298, Visits: 1,306
da-zero (5/20/2010)

Well, it could have been a trick question


Yes, it was a trick question
Nitpickers concentrate on +=, others will find XML category




See, understand, learn, try, use efficient
© Dr.Plch
Post #924861
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse