i am trying to add xml to the xml data type column. The xml contains both
english and hebrew characters. English characters are saved well, but hebrew
saved as "''?" how can i fix it?Try converting the xml to varbinary(max) before inserting. From BOL:
Text Encoding
SQL Server 2005 stores XML data in Unicode (UTF-16). XML data retrieved from
the server comes out in UTF-16 encoding. If you want a different encoding,
you have to perform the required conversion on the retrieved data.
Sometimes, the XML data may be in a different encoding. If it is, you have
to use care during data loading. For example:
a.. If your text XML is in Unicode (UCS-2, UTF-16), you can assign it to
an XML column, variable, or parameter without any problems.
b.. If the encoding is not Unicode and is implicit, because of the source
code page, the string code page in the database should be the same as or
compatible with the code points that you want to load. If required, use
COLLATE. If no such server code page exists, you have to add an explicit XML
declaration with the correct encoding.
c.. To use an explicit encoding, use either the varbinary() type, which
has no interaction with code pages, or use a string type of the appropriate
code page. Then, assign the data to an XML column, variable, or parameter.
Example: Explicitly Specifying an Encoding
Assume that you have an XML document, vcdoc, stored as varchar(max) that
does not have an explicit XML declaration. The following statement adds an
XML declaration with the encoding "iso8859-1", concatenates the XML
document, casts the result to varbinary(max) so that the byte representation
is preserved, and then finally casts it to XML. This enables the XML
processor to parse the data according to the specified encoding "iso8859-1"
and generate the corresponding UTF-16 representation for string values.
SELECT CAST(
CAST (('<?xml version="1.0" encoding="iso8859-1"?>'+ vcdoc) AS VARBINARY
(MAX))
AS XML)
David Barber [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"michael" <michael@.discussions.microsoft.com> wrote in message
news:19B65A8D-E246-46EB-A85B-C517D1830BAD@.microsoft.com...
> i am trying to add xml to the xml data type column. The xml contains both
> english and hebrew characters. English characters are saved well, but
hebrew
> saved as "''?" how can i fix it?|||Thanks a lot
"David Barber [MS]" wrote:
> Try converting the xml to varbinary(max) before inserting. From BOL:
> Text Encoding
> SQL Server 2005 stores XML data in Unicode (UTF-16). XML data retrieved fr
om
> the server comes out in UTF-16 encoding. If you want a different encoding,
> you have to perform the required conversion on the retrieved data.
> Sometimes, the XML data may be in a different encoding. If it is, you have
> to use care during data loading. For example:
> a.. If your text XML is in Unicode (UCS-2, UTF-16), you can assign it to
> an XML column, variable, or parameter without any problems.
>
> b.. If the encoding is not Unicode and is implicit, because of the sourc
e
> code page, the string code page in the database should be the same as or
> compatible with the code points that you want to load. If required, use
> COLLATE. If no such server code page exists, you have to add an explicit X
ML
> declaration with the correct encoding.
>
> c.. To use an explicit encoding, use either the varbinary() type, which
> has no interaction with code pages, or use a string type of the appropriat
e
> code page. Then, assign the data to an XML column, variable, or parameter.
>
> Example: Explicitly Specifying an Encoding
> Assume that you have an XML document, vcdoc, stored as varchar(max) that
> does not have an explicit XML declaration. The following statement adds an
> XML declaration with the encoding "iso8859-1", concatenates the XML
> document, casts the result to varbinary(max) so that the byte representati
on
> is preserved, and then finally casts it to XML. This enables the XML
> processor to parse the data according to the specified encoding "iso8859-1
"
> and generate the corresponding UTF-16 representation for string values.
>
> SELECT CAST(
> CAST (('<?xml version="1.0" encoding="iso8859-1"?>'+ vcdoc) AS VARBINARY
> (MAX))
> AS XML)
>
> --
> David Barber [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
> "michael" <michael@.discussions.microsoft.com> wrote in message
> news:19B65A8D-E246-46EB-A85B-C517D1830BAD@.microsoft.com...
> hebrew
>
>
Showing posts with label characters. Show all posts
Showing posts with label characters. Show all posts
Thursday, March 8, 2012
Tuesday, February 14, 2012
CSV export with characters "ÿþ"
CSV export with characters "ÿþ":
Using reporting services and URL encoding I'm exporting about 1000 records
to CSV format, after exporting i always these " ÿþ " special characters as
the beginning of the file.
these character can be seen clearly only if opened with office 97 or earlier
or with any HEX viewer.
It seems its a common problem with excel formatting.
http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
Does anyone has the same problem? I am not able to use this CSV for printing
with the printing softwares unless i manually remove these characters.
This problem disappeared if I select all data from CSV and paste it to a new
NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
Cheers,
SRM.The CSV export from Report Manager uses the Unicode format for the CSV
created. You could try doing a jump to URL that specifies the ASCII format.
It is one of the options you can provide on the URL. Give that a try and see
if it solves the problem for you. It also solves the issue with Excel
opening it and putting everything in a single column. When exported as ASCII
CSV it opens up in Excel in all the correct columns.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"srm" <srm@.discussions.microsoft.com> wrote in message
news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
> CSV export with characters "ÿþ":
> Using reporting services and URL encoding I'm exporting about 1000 records
> to CSV format, after exporting i always these " ÿþ " special characters as
> the beginning of the file.
> these character can be seen clearly only if opened with office 97 or
> earlier
> or with any HEX viewer.
> It seems its a common problem with excel formatting.
> http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
> Does anyone has the same problem? I am not able to use this CSV for
> printing
> with the printing softwares unless i manually remove these characters.
> This problem disappeared if I select all data from CSV and paste it to a
> new
> NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
> Cheers,
> SRM.|||Tried with rs:Encoding=ASCII into the URL.
But did not remove those Characters. It's the same export format.
Given below is the part of the parameters within URL.
&rs:Command=Render&rs:Format=CSV&rc:Toolbar=false&rs:Encoding=ASCII&rc:Qualifier=*?&rc:NoHeader=true&rc:FieldDelimiter="|"&ProcessID=19653
Thank you.
Roy.
"Bruce L-C [MVP]" wrote:
> The CSV export from Report Manager uses the Unicode format for the CSV
> created. You could try doing a jump to URL that specifies the ASCII format.
> It is one of the options you can provide on the URL. Give that a try and see
> if it solves the problem for you. It also solves the issue with Excel
> opening it and putting everything in a single column. When exported as ASCII
> CSV it opens up in Excel in all the correct columns.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "srm" <srm@.discussions.microsoft.com> wrote in message
> news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
> > CSV export with characters "ÿþ":
> >
> > Using reporting services and URL encoding I'm exporting about 1000 records
> > to CSV format, after exporting i always these " ÿþ " special characters as
> > the beginning of the file.
> >
> > these character can be seen clearly only if opened with office 97 or
> > earlier
> > or with any HEX viewer.
> >
> > It seems its a common problem with excel formatting.
> >
> > http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
> >
> > Does anyone has the same problem? I am not able to use this CSV for
> > printing
> > with the printing softwares unless i manually remove these characters.
> >
> > This problem disappeared if I select all data from CSV and paste it to a
> > new
> > NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
> >
> > Cheers,
> > SRM.
>
>|||Oh well. It was worth a try. I don't have any other suggestions.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"srm" <srm@.discussions.microsoft.com> wrote in message
news:F88C961C-25A5-4DC7-9F75-22EB9D9AB99A@.microsoft.com...
> Tried with rs:Encoding=ASCII into the URL.
> But did not remove those Characters. It's the same export format.
> Given below is the part of the parameters within URL.
> &rs:Command=Render&rs:Format=CSV&rc:Toolbar=false&rs:Encoding=ASCII&rc:Qualifier=*?&rc:NoHeader=true&rc:FieldDelimiter="|"&ProcessID=19653
> Thank you.
> Roy.
>
> "Bruce L-C [MVP]" wrote:
>> The CSV export from Report Manager uses the Unicode format for the CSV
>> created. You could try doing a jump to URL that specifies the ASCII
>> format.
>> It is one of the options you can provide on the URL. Give that a try and
>> see
>> if it solves the problem for you. It also solves the issue with Excel
>> opening it and putting everything in a single column. When exported as
>> ASCII
>> CSV it opens up in Excel in all the correct columns.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "srm" <srm@.discussions.microsoft.com> wrote in message
>> news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
>> > CSV export with characters "ÿþ":
>> >
>> > Using reporting services and URL encoding I'm exporting about 1000
>> > records
>> > to CSV format, after exporting i always these " ÿþ " special characters
>> > as
>> > the beginning of the file.
>> >
>> > these character can be seen clearly only if opened with office 97 or
>> > earlier
>> > or with any HEX viewer.
>> >
>> > It seems its a common problem with excel formatting.
>> >
>> > http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
>> >
>> > Does anyone has the same problem? I am not able to use this CSV for
>> > printing
>> > with the printing softwares unless i manually remove these characters.
>> >
>> > This problem disappeared if I select all data from CSV and paste it to
>> > a
>> > new
>> > NOTEPAD and save as CSV. Is there any other way to avoid this extra
>> > work.
>> >
>> > Cheers,
>> > SRM.
>>|||Instead of &rs:Encoding try &rc:Encoding
HTH
"srm" wrote:
> Tried with rs:Encoding=ASCII into the URL.
> But did not remove those Characters. It's the same export format.
> Given below is the part of the parameters within URL.
> &rs:Command=Render&rs:Format=CSV&rc:Toolbar=false&rs:Encoding=ASCII&rc:Qualifier=*?&rc:NoHeader=true&rc:FieldDelimiter="|"&ProcessID=19653
> Thank you.
> Roy.
>
> "Bruce L-C [MVP]" wrote:
> > The CSV export from Report Manager uses the Unicode format for the CSV
> > created. You could try doing a jump to URL that specifies the ASCII format.
> > It is one of the options you can provide on the URL. Give that a try and see
> > if it solves the problem for you. It also solves the issue with Excel
> > opening it and putting everything in a single column. When exported as ASCII
> > CSV it opens up in Excel in all the correct columns.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "srm" <srm@.discussions.microsoft.com> wrote in message
> > news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
> > > CSV export with characters "ÿþ":
> > >
> > > Using reporting services and URL encoding I'm exporting about 1000 records
> > > to CSV format, after exporting i always these " ÿþ " special characters as
> > > the beginning of the file.
> > >
> > > these character can be seen clearly only if opened with office 97 or
> > > earlier
> > > or with any HEX viewer.
> > >
> > > It seems its a common problem with excel formatting.
> > >
> > > http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
> > >
> > > Does anyone has the same problem? I am not able to use this CSV for
> > > printing
> > > with the printing softwares unless i manually remove these characters.
> > >
> > > This problem disappeared if I select all data from CSV and paste it to a
> > > new
> > > NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
> > >
> > > Cheers,
> > > SRM.
> >
> >
> >
Using reporting services and URL encoding I'm exporting about 1000 records
to CSV format, after exporting i always these " ÿþ " special characters as
the beginning of the file.
these character can be seen clearly only if opened with office 97 or earlier
or with any HEX viewer.
It seems its a common problem with excel formatting.
http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
Does anyone has the same problem? I am not able to use this CSV for printing
with the printing softwares unless i manually remove these characters.
This problem disappeared if I select all data from CSV and paste it to a new
NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
Cheers,
SRM.The CSV export from Report Manager uses the Unicode format for the CSV
created. You could try doing a jump to URL that specifies the ASCII format.
It is one of the options you can provide on the URL. Give that a try and see
if it solves the problem for you. It also solves the issue with Excel
opening it and putting everything in a single column. When exported as ASCII
CSV it opens up in Excel in all the correct columns.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"srm" <srm@.discussions.microsoft.com> wrote in message
news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
> CSV export with characters "ÿþ":
> Using reporting services and URL encoding I'm exporting about 1000 records
> to CSV format, after exporting i always these " ÿþ " special characters as
> the beginning of the file.
> these character can be seen clearly only if opened with office 97 or
> earlier
> or with any HEX viewer.
> It seems its a common problem with excel formatting.
> http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
> Does anyone has the same problem? I am not able to use this CSV for
> printing
> with the printing softwares unless i manually remove these characters.
> This problem disappeared if I select all data from CSV and paste it to a
> new
> NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
> Cheers,
> SRM.|||Tried with rs:Encoding=ASCII into the URL.
But did not remove those Characters. It's the same export format.
Given below is the part of the parameters within URL.
&rs:Command=Render&rs:Format=CSV&rc:Toolbar=false&rs:Encoding=ASCII&rc:Qualifier=*?&rc:NoHeader=true&rc:FieldDelimiter="|"&ProcessID=19653
Thank you.
Roy.
"Bruce L-C [MVP]" wrote:
> The CSV export from Report Manager uses the Unicode format for the CSV
> created. You could try doing a jump to URL that specifies the ASCII format.
> It is one of the options you can provide on the URL. Give that a try and see
> if it solves the problem for you. It also solves the issue with Excel
> opening it and putting everything in a single column. When exported as ASCII
> CSV it opens up in Excel in all the correct columns.
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "srm" <srm@.discussions.microsoft.com> wrote in message
> news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
> > CSV export with characters "ÿþ":
> >
> > Using reporting services and URL encoding I'm exporting about 1000 records
> > to CSV format, after exporting i always these " ÿþ " special characters as
> > the beginning of the file.
> >
> > these character can be seen clearly only if opened with office 97 or
> > earlier
> > or with any HEX viewer.
> >
> > It seems its a common problem with excel formatting.
> >
> > http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
> >
> > Does anyone has the same problem? I am not able to use this CSV for
> > printing
> > with the printing softwares unless i manually remove these characters.
> >
> > This problem disappeared if I select all data from CSV and paste it to a
> > new
> > NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
> >
> > Cheers,
> > SRM.
>
>|||Oh well. It was worth a try. I don't have any other suggestions.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"srm" <srm@.discussions.microsoft.com> wrote in message
news:F88C961C-25A5-4DC7-9F75-22EB9D9AB99A@.microsoft.com...
> Tried with rs:Encoding=ASCII into the URL.
> But did not remove those Characters. It's the same export format.
> Given below is the part of the parameters within URL.
> &rs:Command=Render&rs:Format=CSV&rc:Toolbar=false&rs:Encoding=ASCII&rc:Qualifier=*?&rc:NoHeader=true&rc:FieldDelimiter="|"&ProcessID=19653
> Thank you.
> Roy.
>
> "Bruce L-C [MVP]" wrote:
>> The CSV export from Report Manager uses the Unicode format for the CSV
>> created. You could try doing a jump to URL that specifies the ASCII
>> format.
>> It is one of the options you can provide on the URL. Give that a try and
>> see
>> if it solves the problem for you. It also solves the issue with Excel
>> opening it and putting everything in a single column. When exported as
>> ASCII
>> CSV it opens up in Excel in all the correct columns.
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>> "srm" <srm@.discussions.microsoft.com> wrote in message
>> news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
>> > CSV export with characters "ÿþ":
>> >
>> > Using reporting services and URL encoding I'm exporting about 1000
>> > records
>> > to CSV format, after exporting i always these " ÿþ " special characters
>> > as
>> > the beginning of the file.
>> >
>> > these character can be seen clearly only if opened with office 97 or
>> > earlier
>> > or with any HEX viewer.
>> >
>> > It seems its a common problem with excel formatting.
>> >
>> > http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
>> >
>> > Does anyone has the same problem? I am not able to use this CSV for
>> > printing
>> > with the printing softwares unless i manually remove these characters.
>> >
>> > This problem disappeared if I select all data from CSV and paste it to
>> > a
>> > new
>> > NOTEPAD and save as CSV. Is there any other way to avoid this extra
>> > work.
>> >
>> > Cheers,
>> > SRM.
>>|||Instead of &rs:Encoding try &rc:Encoding
HTH
"srm" wrote:
> Tried with rs:Encoding=ASCII into the URL.
> But did not remove those Characters. It's the same export format.
> Given below is the part of the parameters within URL.
> &rs:Command=Render&rs:Format=CSV&rc:Toolbar=false&rs:Encoding=ASCII&rc:Qualifier=*?&rc:NoHeader=true&rc:FieldDelimiter="|"&ProcessID=19653
> Thank you.
> Roy.
>
> "Bruce L-C [MVP]" wrote:
> > The CSV export from Report Manager uses the Unicode format for the CSV
> > created. You could try doing a jump to URL that specifies the ASCII format.
> > It is one of the options you can provide on the URL. Give that a try and see
> > if it solves the problem for you. It also solves the issue with Excel
> > opening it and putting everything in a single column. When exported as ASCII
> > CSV it opens up in Excel in all the correct columns.
> >
> >
> > --
> > Bruce Loehle-Conger
> > MVP SQL Server Reporting Services
> >
> > "srm" <srm@.discussions.microsoft.com> wrote in message
> > news:2E59C2AE-833B-45B1-8FFE-84784B0AF82E@.microsoft.com...
> > > CSV export with characters "ÿþ":
> > >
> > > Using reporting services and URL encoding I'm exporting about 1000 records
> > > to CSV format, after exporting i always these " ÿþ " special characters as
> > > the beginning of the file.
> > >
> > > these character can be seen clearly only if opened with office 97 or
> > > earlier
> > > or with any HEX viewer.
> > >
> > > It seems its a common problem with excel formatting.
> > >
> > > http://groups.google.com.au/group/microsoft.public.excel.programming/browse_thread/thread/e540d95a1f3e83ae/4828dd254c80c8b9?q=%C3%BF%C3%BE+in+csv&rnum=2&hl=en
> > >
> > > Does anyone has the same problem? I am not able to use this CSV for
> > > printing
> > > with the printing softwares unless i manually remove these characters.
> > >
> > > This problem disappeared if I select all data from CSV and paste it to a
> > > new
> > > NOTEPAD and save as CSV. Is there any other way to avoid this extra work.
> > >
> > > Cheers,
> > > SRM.
> >
> >
> >
Subscribe to:
Posts (Atom)