Most of the characters are stored in a Single byte but some Japanese
Characters requires Two Bytes to store Characters. Is there anyway to
store those characters in a Single byte? I am looking for the query or
any other tool. Is this possible with SQL Server or any other
programming Languages?
MadhivananAs there are potentially several thousand Kanji characters and only 256
possible values for a byte it really isn't possible to use 1 byte per
character.
Use the Unicode datatypes (NCHAR, NVARCHAR, NTEXT) to store multi-national
character sets. You can read about those in Books Online.
David Portas
SQL Server MVP
--
Showing posts with label characters. Show all posts
Showing posts with label characters. Show all posts
Friday, March 9, 2012
Double Byte Characters scrambled in PDF Output
Does anybody know how I can Clean up some European Characters such as "?"
in a text field:
"45000 m² new office project designed by Arquitectonica. Revised proposal
and clarifications issued to client on 26 Aug: 1239K? for MOEX, 985K for
Synthese as option. Ten competitors, including Coteba. Contract award
expected by 15 Sept 04."
Is there a certain data type to use or is there a conversion fucntion to
use?
HelpWhat you can do in this case is :
write custom code for all the clean up.
You can write code tab of the Report Properties in the Report tab under main menu.
Write your own VB.NET code.
>--Original Message--
>Does anybody know how I can Clean up some European Characters such as "?"
>in a text field:
>"45000 m=B2 new office project designed by Arquitectonica. Revised proposal
>and clarifications issued to client on 26 Aug: 1239K? for MOEX, 985K for
>Synthese as option. Ten competitors, including Coteba. Contract award
>expected by 15 Sept 04."
>Is there a certain data type to use or is there a conversion fucntion to
>use?
>Help
>
>.
>
in a text field:
"45000 m² new office project designed by Arquitectonica. Revised proposal
and clarifications issued to client on 26 Aug: 1239K? for MOEX, 985K for
Synthese as option. Ten competitors, including Coteba. Contract award
expected by 15 Sept 04."
Is there a certain data type to use or is there a conversion fucntion to
use?
HelpWhat you can do in this case is :
write custom code for all the clean up.
You can write code tab of the Report Properties in the Report tab under main menu.
Write your own VB.NET code.
>--Original Message--
>Does anybody know how I can Clean up some European Characters such as "?"
>in a text field:
>"45000 m=B2 new office project designed by Arquitectonica. Revised proposal
>and clarifications issued to client on 26 Aug: 1239K? for MOEX, 985K for
>Synthese as option. Ten competitors, including Coteba. Contract award
>expected by 15 Sept 04."
>Is there a certain data type to use or is there a conversion fucntion to
>use?
>Help
>
>.
>
Double Byte Character Problem
I am storing text in sql server 2000. DataType for the field is ntext. I am
storing a string which has characters both in english and in Japanese. If the
number of characters in string are upto 4000 then every thing works fine. If
I retrieve the data it shows me exactly the string which I stored. But the
moment chracters exceed 4000(even 4001) the japanese characters are converted
to question mark("?") . Collation for the database is
SQL_Latin1_General_CP1_Cl_AS. Please help me.
Thank you.
Junaid Rehman
Are you observing this behavior from Query Analyzer or your application
program?
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>I am storing text in sql server 2000. DataType for the field is ntext. I am
> storing a string which has characters both in english and in Japanese. If
> the
> number of characters in string are upto 4000 then every thing works fine.
> If
> I retrieve the data it shows me exactly the string which I stored. But the
> moment chracters exceed 4000(even 4001) the japanese characters are
> converted
> to question mark("?") . Collation for the database is
> SQL_Latin1_General_CP1_Cl_AS. Please help me.
> Thank you.
> Junaid Rehman
|||I made a simple page in vb.net which has two textboxes and a submit button. I
enter the text in first textbox and when I submit the form data is inserted
into database. When the characters entered in textbox are less then 4000 the
data which is inserted in database has japanese characters represented as
small boxes. Then I retrieve the the data stored in database in 2nd textbox
and it appears fine. But when characters entered in first textbox exceed 4000
the data which is inserted into database has japanese characters converted to
question mark("?") instead of those small boxes (which were there earlier
when characters were less then 4000). When I retrieve this text in 2nd box it
shows question marks instead of Japanese characters. I explained it in bit
detail so that you know what I am exactly doing.
Junaid Rehman
"Dan Guzman" wrote:
> Are you observing this behavior from Query Analyzer or your application
> program?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>
>
|||Below is a code snippet that properly stores unicode values as described in
your narrative. Also, I used a font that properly rendered the unicode
characters. You might check this against your code. If you still have
problems, please post your code.
Dim mySqlConnection As New SqlConnection(connectionString)
mySqlConnection.Open()
Dim mySqlCommand As New SqlCommand
mySqlCommand.Connection = mySqlConnection
'create test table
mySqlCommand.CommandText = "CREATE TABLE #MyTable(MyData ntext)"
mySqlCommand.ExecuteNonQuery()
'create unicode value from form
mySqlCommand.CommandText = "INSERT INTO #MyTable VALUES(@.MyData)"
Dim myDataParamter As New SqlParameter("@.MyData", SqlDbType.NText)
myDataParamter.Value = Me.TextBox1.Text
mySqlCommand.Parameters.Add(myDataParamter)
mySqlCommand.ExecuteNonQuery()
'retrieve inserted value
mySqlCommand.CommandText = "SELECT MyData FROM #MyTable"
Dim SqlDataReader As SqlDataReader = mySqlCommand.ExecuteReader
SqlDataReader.Read()
Me.TextBox2.Text = SqlDataReader.GetString(0)
SqlDataReader.Close()
'cleanup
mySqlCommand.CommandText = "DROP TABLE #MyTable"
mySqlCommand.ExecuteNonQuery()
mySqlConnection.Close()
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:6C3267D6-DD99-417A-9B65-D40FE6217DF2@.microsoft.com...[vbcol=seagreen]
>I made a simple page in vb.net which has two textboxes and a submit button.
>I
> enter the text in first textbox and when I submit the form data is
> inserted
> into database. When the characters entered in textbox are less then 4000
> the
> data which is inserted in database has japanese characters represented as
> small boxes. Then I retrieve the the data stored in database in 2nd
> textbox
> and it appears fine. But when characters entered in first textbox exceed
> 4000
> the data which is inserted into database has japanese characters converted
> to
> question mark("?") instead of those small boxes (which were there earlier
> when characters were less then 4000). When I retrieve this text in 2nd box
> it
> shows question marks instead of Japanese characters. I explained it in bit
> detail so that you know what I am exactly doing.
> Junaid Rehman
> "Dan Guzman" wrote:
storing a string which has characters both in english and in Japanese. If the
number of characters in string are upto 4000 then every thing works fine. If
I retrieve the data it shows me exactly the string which I stored. But the
moment chracters exceed 4000(even 4001) the japanese characters are converted
to question mark("?") . Collation for the database is
SQL_Latin1_General_CP1_Cl_AS. Please help me.
Thank you.
Junaid Rehman
Are you observing this behavior from Query Analyzer or your application
program?
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>I am storing text in sql server 2000. DataType for the field is ntext. I am
> storing a string which has characters both in english and in Japanese. If
> the
> number of characters in string are upto 4000 then every thing works fine.
> If
> I retrieve the data it shows me exactly the string which I stored. But the
> moment chracters exceed 4000(even 4001) the japanese characters are
> converted
> to question mark("?") . Collation for the database is
> SQL_Latin1_General_CP1_Cl_AS. Please help me.
> Thank you.
> Junaid Rehman
|||I made a simple page in vb.net which has two textboxes and a submit button. I
enter the text in first textbox and when I submit the form data is inserted
into database. When the characters entered in textbox are less then 4000 the
data which is inserted in database has japanese characters represented as
small boxes. Then I retrieve the the data stored in database in 2nd textbox
and it appears fine. But when characters entered in first textbox exceed 4000
the data which is inserted into database has japanese characters converted to
question mark("?") instead of those small boxes (which were there earlier
when characters were less then 4000). When I retrieve this text in 2nd box it
shows question marks instead of Japanese characters. I explained it in bit
detail so that you know what I am exactly doing.
Junaid Rehman
"Dan Guzman" wrote:
> Are you observing this behavior from Query Analyzer or your application
> program?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>
>
|||Below is a code snippet that properly stores unicode values as described in
your narrative. Also, I used a font that properly rendered the unicode
characters. You might check this against your code. If you still have
problems, please post your code.
Dim mySqlConnection As New SqlConnection(connectionString)
mySqlConnection.Open()
Dim mySqlCommand As New SqlCommand
mySqlCommand.Connection = mySqlConnection
'create test table
mySqlCommand.CommandText = "CREATE TABLE #MyTable(MyData ntext)"
mySqlCommand.ExecuteNonQuery()
'create unicode value from form
mySqlCommand.CommandText = "INSERT INTO #MyTable VALUES(@.MyData)"
Dim myDataParamter As New SqlParameter("@.MyData", SqlDbType.NText)
myDataParamter.Value = Me.TextBox1.Text
mySqlCommand.Parameters.Add(myDataParamter)
mySqlCommand.ExecuteNonQuery()
'retrieve inserted value
mySqlCommand.CommandText = "SELECT MyData FROM #MyTable"
Dim SqlDataReader As SqlDataReader = mySqlCommand.ExecuteReader
SqlDataReader.Read()
Me.TextBox2.Text = SqlDataReader.GetString(0)
SqlDataReader.Close()
'cleanup
mySqlCommand.CommandText = "DROP TABLE #MyTable"
mySqlCommand.ExecuteNonQuery()
mySqlConnection.Close()
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:6C3267D6-DD99-417A-9B65-D40FE6217DF2@.microsoft.com...[vbcol=seagreen]
>I made a simple page in vb.net which has two textboxes and a submit button.
>I
> enter the text in first textbox and when I submit the form data is
> inserted
> into database. When the characters entered in textbox are less then 4000
> the
> data which is inserted in database has japanese characters represented as
> small boxes. Then I retrieve the the data stored in database in 2nd
> textbox
> and it appears fine. But when characters entered in first textbox exceed
> 4000
> the data which is inserted into database has japanese characters converted
> to
> question mark("?") instead of those small boxes (which were there earlier
> when characters were less then 4000). When I retrieve this text in 2nd box
> it
> shows question marks instead of Japanese characters. I explained it in bit
> detail so that you know what I am exactly doing.
> Junaid Rehman
> "Dan Guzman" wrote:
Double Byte Character Problem
I am storing text in sql server 2000. DataType for the field is ntext. I am
storing a string which has characters both in english and in Japanese. If the
number of characters in string are upto 4000 then every thing works fine. If
I retrieve the data it shows me exactly the string which I stored. But the
moment chracters exceed 4000(even 4001) the japanese characters are converted
to question mark("?") . Collation for the database is
SQL_Latin1_General_CP1_Cl_AS. Please help me.
Thank you.
Junaid RehmanAre you observing this behavior from Query Analyzer or your application
program?
--
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>I am storing text in sql server 2000. DataType for the field is ntext. I am
> storing a string which has characters both in english and in Japanese. If
> the
> number of characters in string are upto 4000 then every thing works fine.
> If
> I retrieve the data it shows me exactly the string which I stored. But the
> moment chracters exceed 4000(even 4001) the japanese characters are
> converted
> to question mark("?") . Collation for the database is
> SQL_Latin1_General_CP1_Cl_AS. Please help me.
> Thank you.
> Junaid Rehman|||I made a simple page in vb.net which has two textboxes and a submit button. I
enter the text in first textbox and when I submit the form data is inserted
into database. When the characters entered in textbox are less then 4000 the
data which is inserted in database has japanese characters represented as
small boxes. Then I retrieve the the data stored in database in 2nd textbox
and it appears fine. But when characters entered in first textbox exceed 4000
the data which is inserted into database has japanese characters converted to
question mark("?") instead of those small boxes (which were there earlier
when characters were less then 4000). When I retrieve this text in 2nd box it
shows question marks instead of Japanese characters. I explained it in bit
detail so that you know what I am exactly doing.
Junaid Rehman
"Dan Guzman" wrote:
> Are you observing this behavior from Query Analyzer or your application
> program?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
> >I am storing text in sql server 2000. DataType for the field is ntext. I am
> > storing a string which has characters both in english and in Japanese. If
> > the
> > number of characters in string are upto 4000 then every thing works fine.
> > If
> > I retrieve the data it shows me exactly the string which I stored. But the
> > moment chracters exceed 4000(even 4001) the japanese characters are
> > converted
> > to question mark("?") . Collation for the database is
> > SQL_Latin1_General_CP1_Cl_AS. Please help me.
> > Thank you.
> >
> > Junaid Rehman
>
>|||Below is a code snippet that properly stores unicode values as described in
your narrative. Also, I used a font that properly rendered the unicode
characters. You might check this against your code. If you still have
problems, please post your code.
Dim mySqlConnection As New SqlConnection(connectionString)
mySqlConnection.Open()
Dim mySqlCommand As New SqlCommand
mySqlCommand.Connection = mySqlConnection
'create test table
mySqlCommand.CommandText = "CREATE TABLE #MyTable(MyData ntext)"
mySqlCommand.ExecuteNonQuery()
'create unicode value from form
mySqlCommand.CommandText = "INSERT INTO #MyTable VALUES(@.MyData)"
Dim myDataParamter As New SqlParameter("@.MyData", SqlDbType.NText)
myDataParamter.Value = Me.TextBox1.Text
mySqlCommand.Parameters.Add(myDataParamter)
mySqlCommand.ExecuteNonQuery()
'retrieve inserted value
mySqlCommand.CommandText = "SELECT MyData FROM #MyTable"
Dim SqlDataReader As SqlDataReader = mySqlCommand.ExecuteReader
SqlDataReader.Read()
Me.TextBox2.Text = SqlDataReader.GetString(0)
SqlDataReader.Close()
'cleanup
mySqlCommand.CommandText = "DROP TABLE #MyTable"
mySqlCommand.ExecuteNonQuery()
mySqlConnection.Close()
--
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:6C3267D6-DD99-417A-9B65-D40FE6217DF2@.microsoft.com...
>I made a simple page in vb.net which has two textboxes and a submit button.
>I
> enter the text in first textbox and when I submit the form data is
> inserted
> into database. When the characters entered in textbox are less then 4000
> the
> data which is inserted in database has japanese characters represented as
> small boxes. Then I retrieve the the data stored in database in 2nd
> textbox
> and it appears fine. But when characters entered in first textbox exceed
> 4000
> the data which is inserted into database has japanese characters converted
> to
> question mark("?") instead of those small boxes (which were there earlier
> when characters were less then 4000). When I retrieve this text in 2nd box
> it
> shows question marks instead of Japanese characters. I explained it in bit
> detail so that you know what I am exactly doing.
> Junaid Rehman
> "Dan Guzman" wrote:
>> Are you observing this behavior from Query Analyzer or your application
>> program?
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
>> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>> >I am storing text in sql server 2000. DataType for the field is ntext. I
>> >am
>> > storing a string which has characters both in english and in Japanese.
>> > If
>> > the
>> > number of characters in string are upto 4000 then every thing works
>> > fine.
>> > If
>> > I retrieve the data it shows me exactly the string which I stored. But
>> > the
>> > moment chracters exceed 4000(even 4001) the japanese characters are
>> > converted
>> > to question mark("?") . Collation for the database is
>> > SQL_Latin1_General_CP1_Cl_AS. Please help me.
>> > Thank you.
>> >
>> > Junaid Rehman
>>
storing a string which has characters both in english and in Japanese. If the
number of characters in string are upto 4000 then every thing works fine. If
I retrieve the data it shows me exactly the string which I stored. But the
moment chracters exceed 4000(even 4001) the japanese characters are converted
to question mark("?") . Collation for the database is
SQL_Latin1_General_CP1_Cl_AS. Please help me.
Thank you.
Junaid RehmanAre you observing this behavior from Query Analyzer or your application
program?
--
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>I am storing text in sql server 2000. DataType for the field is ntext. I am
> storing a string which has characters both in english and in Japanese. If
> the
> number of characters in string are upto 4000 then every thing works fine.
> If
> I retrieve the data it shows me exactly the string which I stored. But the
> moment chracters exceed 4000(even 4001) the japanese characters are
> converted
> to question mark("?") . Collation for the database is
> SQL_Latin1_General_CP1_Cl_AS. Please help me.
> Thank you.
> Junaid Rehman|||I made a simple page in vb.net which has two textboxes and a submit button. I
enter the text in first textbox and when I submit the form data is inserted
into database. When the characters entered in textbox are less then 4000 the
data which is inserted in database has japanese characters represented as
small boxes. Then I retrieve the the data stored in database in 2nd textbox
and it appears fine. But when characters entered in first textbox exceed 4000
the data which is inserted into database has japanese characters converted to
question mark("?") instead of those small boxes (which were there earlier
when characters were less then 4000). When I retrieve this text in 2nd box it
shows question marks instead of Japanese characters. I explained it in bit
detail so that you know what I am exactly doing.
Junaid Rehman
"Dan Guzman" wrote:
> Are you observing this behavior from Query Analyzer or your application
> program?
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
> >I am storing text in sql server 2000. DataType for the field is ntext. I am
> > storing a string which has characters both in english and in Japanese. If
> > the
> > number of characters in string are upto 4000 then every thing works fine.
> > If
> > I retrieve the data it shows me exactly the string which I stored. But the
> > moment chracters exceed 4000(even 4001) the japanese characters are
> > converted
> > to question mark("?") . Collation for the database is
> > SQL_Latin1_General_CP1_Cl_AS. Please help me.
> > Thank you.
> >
> > Junaid Rehman
>
>|||Below is a code snippet that properly stores unicode values as described in
your narrative. Also, I used a font that properly rendered the unicode
characters. You might check this against your code. If you still have
problems, please post your code.
Dim mySqlConnection As New SqlConnection(connectionString)
mySqlConnection.Open()
Dim mySqlCommand As New SqlCommand
mySqlCommand.Connection = mySqlConnection
'create test table
mySqlCommand.CommandText = "CREATE TABLE #MyTable(MyData ntext)"
mySqlCommand.ExecuteNonQuery()
'create unicode value from form
mySqlCommand.CommandText = "INSERT INTO #MyTable VALUES(@.MyData)"
Dim myDataParamter As New SqlParameter("@.MyData", SqlDbType.NText)
myDataParamter.Value = Me.TextBox1.Text
mySqlCommand.Parameters.Add(myDataParamter)
mySqlCommand.ExecuteNonQuery()
'retrieve inserted value
mySqlCommand.CommandText = "SELECT MyData FROM #MyTable"
Dim SqlDataReader As SqlDataReader = mySqlCommand.ExecuteReader
SqlDataReader.Read()
Me.TextBox2.Text = SqlDataReader.GetString(0)
SqlDataReader.Close()
'cleanup
mySqlCommand.CommandText = "DROP TABLE #MyTable"
mySqlCommand.ExecuteNonQuery()
mySqlConnection.Close()
--
Hope this helps.
Dan Guzman
SQL Server MVP
"rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
news:6C3267D6-DD99-417A-9B65-D40FE6217DF2@.microsoft.com...
>I made a simple page in vb.net which has two textboxes and a submit button.
>I
> enter the text in first textbox and when I submit the form data is
> inserted
> into database. When the characters entered in textbox are less then 4000
> the
> data which is inserted in database has japanese characters represented as
> small boxes. Then I retrieve the the data stored in database in 2nd
> textbox
> and it appears fine. But when characters entered in first textbox exceed
> 4000
> the data which is inserted into database has japanese characters converted
> to
> question mark("?") instead of those small boxes (which were there earlier
> when characters were less then 4000). When I retrieve this text in 2nd box
> it
> shows question marks instead of Japanese characters. I explained it in bit
> detail so that you know what I am exactly doing.
> Junaid Rehman
> "Dan Guzman" wrote:
>> Are you observing this behavior from Query Analyzer or your application
>> program?
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "rehmanjr" <rehmanjr@.discussions.microsoft.com> wrote in message
>> news:29958380-55A3-4BC7-9383-5DE2738B0120@.microsoft.com...
>> >I am storing text in sql server 2000. DataType for the field is ntext. I
>> >am
>> > storing a string which has characters both in english and in Japanese.
>> > If
>> > the
>> > number of characters in string are upto 4000 then every thing works
>> > fine.
>> > If
>> > I retrieve the data it shows me exactly the string which I stored. But
>> > the
>> > moment chracters exceed 4000(even 4001) the japanese characters are
>> > converted
>> > to question mark("?") . Collation for the database is
>> > SQL_Latin1_General_CP1_Cl_AS. Please help me.
>> > Thank you.
>> >
>> > Junaid Rehman
>>
Don't want escape characters in results
Hi, I have a varchar column containing text which is actually fragments of
HTML.
eg:
<p>sometext</p>
When I retrieve the data using FOR XML I get results with escaped
characters:
<p>sometext</p>
Is there any way to turn off the escaping and just return the actual data?
Thanks!Can you give an example of the query you are using?
You may simply be able to explicitly cast your varchar
column to xml.|||Nice Sunday.
First of all, your HTML string should be well-formed in XML perspective. If
not, resultant XML will be broken. If you have no problem for your string,
just try this script, and see if this makes any sense for you. You may make
some UDF to make the job more convenient.
drop table t1
go
create table t1 (t varchar(10))
insert into t1 values (N'<a/>')
declare @.x xml
set @.x=(select top 1 t from t1)
select @.x
Pohwan Han. Seoul. Have a nice day.
"Paul Robinson" <robinsonpr@.aol.com> wrote in message
news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
> Hi, I have a varchar column containing text which is actually fragments of
> HTML.
> eg:
> <p>sometext</p>
> When I retrieve the data using FOR XML I get results with escaped
> characters:
> <p>sometext</p>
>
> Is there any way to turn off the escaping and just return the actual data?
> Thanks!
>|||Or convert(),
select convert(xml, t) from t1
Optionally, if your HTML is not well-formed and just want to show the HTML
in browser as HTML, you can use some mid-tier like XSLT with
disable-output-escaping attribute.
Pohwan Han. Seoul. Have a nice day.
"Han" <hp4444@.kornet.net.korea> wrote in message
news:%23hNpSPydGHA.2416@.TK2MSFTNGP03.phx.gbl...
> Nice Sunday.
> First of all, your HTML string should be well-formed in XML perspective.
> If not, resultant XML will be broken. If you have no problem for your
> string, just try this script, and see if this makes any sense for you. You
> may make some UDF to make the job more convenient.
> drop table t1
> go
> create table t1 (t varchar(10))
> insert into t1 values (N'<a/>')
> declare @.x xml
> set @.x=(select top 1 t from t1)
> select @.x
> --
> Pohwan Han. Seoul. Have a nice day.
> "Paul Robinson" <robinsonpr@.aol.com> wrote in message
> news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
>|||I'm using SQLServer2000.
An example query is below (there are more columns but I've just cut it down
to one to illustrate the problem:
select 1 AS [Tag], 0 AS [Parent],
varMemo AS [memo!1!!element],
from memo
FOR XML EXPLICIT
Result:
<memo><p>my test data.</p></memo>
The data column which is a varchar contains this:
<p>my test data.</p>
What I want out is:
<memo><p>my test data.</p></memo>
<markc600@.hotmail.com> wrote in message
news:1147450841.895258.275160@.i39g2000cwa.googlegroups.com...
> Can you give an example of the query you are using?
> You may simply be able to explicitly cast your varchar
> column to xml.
>|||Ah slight problem with the xml data type - we're using SQLServer2000. I
just posted the example query in another part of the thread!
Thanks...
"Han" <hp4444@.kornet.net.korea> wrote in message
news:%23hNpSPydGHA.2416@.TK2MSFTNGP03.phx.gbl...
> Nice Sunday.
> First of all, your HTML string should be well-formed in XML perspective.
If
> not, resultant XML will be broken. If you have no problem for your string,
> just try this script, and see if this makes any sense for you. You may
make
> some UDF to make the job more convenient.
> drop table t1
> go
> create table t1 (t varchar(10))
> insert into t1 values (N'<a/>')
> declare @.x xml
> set @.x=(select top 1 t from t1)
> select @.x
> --
> Pohwan Han. Seoul. Have a nice day.
> "Paul Robinson" <robinsonpr@.aol.com> wrote in message
> news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
of
data?
>|||Try changing
varMemo AS [memo!1!!element],
to
varMemo AS [memo!1!!xml],|||That's got it! Many thanks, I appreciate the help!!
<markc600@.hotmail.com> wrote in message
news:1147684296.310383.20930@.u72g2000cwu.googlegroups.com...
> Try changing
> varMemo AS [memo!1!!element],
> to
> varMemo AS [memo!1!!xml],
>
HTML.
eg:
<p>sometext</p>
When I retrieve the data using FOR XML I get results with escaped
characters:
<p>sometext</p>
Is there any way to turn off the escaping and just return the actual data?
Thanks!Can you give an example of the query you are using?
You may simply be able to explicitly cast your varchar
column to xml.|||Nice Sunday.
First of all, your HTML string should be well-formed in XML perspective. If
not, resultant XML will be broken. If you have no problem for your string,
just try this script, and see if this makes any sense for you. You may make
some UDF to make the job more convenient.
drop table t1
go
create table t1 (t varchar(10))
insert into t1 values (N'<a/>')
declare @.x xml
set @.x=(select top 1 t from t1)
select @.x
Pohwan Han. Seoul. Have a nice day.
"Paul Robinson" <robinsonpr@.aol.com> wrote in message
news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
> Hi, I have a varchar column containing text which is actually fragments of
> HTML.
> eg:
> <p>sometext</p>
> When I retrieve the data using FOR XML I get results with escaped
> characters:
> <p>sometext</p>
>
> Is there any way to turn off the escaping and just return the actual data?
> Thanks!
>|||Or convert(),
select convert(xml, t) from t1
Optionally, if your HTML is not well-formed and just want to show the HTML
in browser as HTML, you can use some mid-tier like XSLT with
disable-output-escaping attribute.
Pohwan Han. Seoul. Have a nice day.
"Han" <hp4444@.kornet.net.korea> wrote in message
news:%23hNpSPydGHA.2416@.TK2MSFTNGP03.phx.gbl...
> Nice Sunday.
> First of all, your HTML string should be well-formed in XML perspective.
> If not, resultant XML will be broken. If you have no problem for your
> string, just try this script, and see if this makes any sense for you. You
> may make some UDF to make the job more convenient.
> drop table t1
> go
> create table t1 (t varchar(10))
> insert into t1 values (N'<a/>')
> declare @.x xml
> set @.x=(select top 1 t from t1)
> select @.x
> --
> Pohwan Han. Seoul. Have a nice day.
> "Paul Robinson" <robinsonpr@.aol.com> wrote in message
> news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
>|||I'm using SQLServer2000.
An example query is below (there are more columns but I've just cut it down
to one to illustrate the problem:
select 1 AS [Tag], 0 AS [Parent],
varMemo AS [memo!1!!element],
from memo
FOR XML EXPLICIT
Result:
<memo><p>my test data.</p></memo>
The data column which is a varchar contains this:
<p>my test data.</p>
What I want out is:
<memo><p>my test data.</p></memo>
<markc600@.hotmail.com> wrote in message
news:1147450841.895258.275160@.i39g2000cwa.googlegroups.com...
> Can you give an example of the query you are using?
> You may simply be able to explicitly cast your varchar
> column to xml.
>|||Ah slight problem with the xml data type - we're using SQLServer2000. I
just posted the example query in another part of the thread!
Thanks...
"Han" <hp4444@.kornet.net.korea> wrote in message
news:%23hNpSPydGHA.2416@.TK2MSFTNGP03.phx.gbl...
> Nice Sunday.
> First of all, your HTML string should be well-formed in XML perspective.
If
> not, resultant XML will be broken. If you have no problem for your string,
> just try this script, and see if this makes any sense for you. You may
make
> some UDF to make the job more convenient.
> drop table t1
> go
> create table t1 (t varchar(10))
> insert into t1 values (N'<a/>')
> declare @.x xml
> set @.x=(select top 1 t from t1)
> select @.x
> --
> Pohwan Han. Seoul. Have a nice day.
> "Paul Robinson" <robinsonpr@.aol.com> wrote in message
> news:uCpDPbddGHA.4128@.TK2MSFTNGP05.phx.gbl...
of
data?
>|||Try changing
varMemo AS [memo!1!!element],
to
varMemo AS [memo!1!!xml],|||That's got it! Many thanks, I appreciate the help!!
<markc600@.hotmail.com> wrote in message
news:1147684296.310383.20930@.u72g2000cwu.googlegroups.com...
> Try changing
> varMemo AS [memo!1!!element],
> to
> varMemo AS [memo!1!!xml],
>
Tuesday, February 14, 2012
Does the parameter of a report has has length limitation?
Hi,
I tried to pass a long sql statement(about 2000 characters) as the parameter
of a report by ReportingService.Render() function, but it always encountered
an exception.
So What's is the max length of a parameter by using web service method?
Thanks.What kind of exception?
What version of RS ?
As far as I know there is no limit is parameter length, especially for web
service method.
But there is definitly a problem with HTML4.0 rendering if a query string is
above 2K in length in RS 2000. RS chocks on that.
I'm using a work around by storing sql statement (parameters) in a separate
table and pass a returned record id from that table
to the reporting server. a stored procedure or a set of sql statements can
retreive that values based on passed id and execute them.
Kind of two step execution, but it works for long parameters.
If you POST to RS - there is no such thing as a query string, but HTML4.0
rendering is still a problem. See above.
"David Zhu" <DavidZhu@.discussions.microsoft.com> wrote in message
news:0BBD7B75-DACB-4710-B863-BCDF6C59E996@.microsoft.com...
> Hi,
> I tried to pass a long sql statement(about 2000 characters) as the
> parameter
> of a report by ReportingService.Render() function, but it always
> encountered
> an exception.
> So What's is the max length of a parameter by using web service method?
> Thanks.
>|||Thank you very much!
"Oleg Yevteyev" wrote:
> What kind of exception?
> What version of RS ?
> As far as I know there is no limit is parameter length, especially for web
> service method.
> But there is definitly a problem with HTML4.0 rendering if a query string is
> above 2K in length in RS 2000. RS chocks on that.
> I'm using a work around by storing sql statement (parameters) in a separate
> table and pass a returned record id from that table
> to the reporting server. a stored procedure or a set of sql statements can
> retreive that values based on passed id and execute them.
> Kind of two step execution, but it works for long parameters.
> If you POST to RS - there is no such thing as a query string, but HTML4.0
> rendering is still a problem. See above.
> "David Zhu" <DavidZhu@.discussions.microsoft.com> wrote in message
> news:0BBD7B75-DACB-4710-B863-BCDF6C59E996@.microsoft.com...
> > Hi,
> >
> > I tried to pass a long sql statement(about 2000 characters) as the
> > parameter
> > of a report by ReportingService.Render() function, but it always
> > encountered
> > an exception.
> >
> > So What's is the max length of a parameter by using web service method?
> >
> > Thanks.
> >
>
>
I tried to pass a long sql statement(about 2000 characters) as the parameter
of a report by ReportingService.Render() function, but it always encountered
an exception.
So What's is the max length of a parameter by using web service method?
Thanks.What kind of exception?
What version of RS ?
As far as I know there is no limit is parameter length, especially for web
service method.
But there is definitly a problem with HTML4.0 rendering if a query string is
above 2K in length in RS 2000. RS chocks on that.
I'm using a work around by storing sql statement (parameters) in a separate
table and pass a returned record id from that table
to the reporting server. a stored procedure or a set of sql statements can
retreive that values based on passed id and execute them.
Kind of two step execution, but it works for long parameters.
If you POST to RS - there is no such thing as a query string, but HTML4.0
rendering is still a problem. See above.
"David Zhu" <DavidZhu@.discussions.microsoft.com> wrote in message
news:0BBD7B75-DACB-4710-B863-BCDF6C59E996@.microsoft.com...
> Hi,
> I tried to pass a long sql statement(about 2000 characters) as the
> parameter
> of a report by ReportingService.Render() function, but it always
> encountered
> an exception.
> So What's is the max length of a parameter by using web service method?
> Thanks.
>|||Thank you very much!
"Oleg Yevteyev" wrote:
> What kind of exception?
> What version of RS ?
> As far as I know there is no limit is parameter length, especially for web
> service method.
> But there is definitly a problem with HTML4.0 rendering if a query string is
> above 2K in length in RS 2000. RS chocks on that.
> I'm using a work around by storing sql statement (parameters) in a separate
> table and pass a returned record id from that table
> to the reporting server. a stored procedure or a set of sql statements can
> retreive that values based on passed id and execute them.
> Kind of two step execution, but it works for long parameters.
> If you POST to RS - there is no such thing as a query string, but HTML4.0
> rendering is still a problem. See above.
> "David Zhu" <DavidZhu@.discussions.microsoft.com> wrote in message
> news:0BBD7B75-DACB-4710-B863-BCDF6C59E996@.microsoft.com...
> > Hi,
> >
> > I tried to pass a long sql statement(about 2000 characters) as the
> > parameter
> > of a report by ReportingService.Render() function, but it always
> > encountered
> > an exception.
> >
> > So What's is the max length of a parameter by using web service method?
> >
> > Thanks.
> >
>
>
Labels:
characters,
database,
function,
limitation,
microsoft,
mysql,
oracle,
parameter,
render,
report,
reportingservice,
server,
sql,
statement
Subscribe to:
Posts (Atom)