テーブルの列としてXMLデータ型があります。私はそこにいくつかのXMLテキストを保存しました。 XMLテキストにはいくつかのヘブライ文字が含まれていますが、テーブルに格納した後はすべてのヘブライ文字が「?」に変わります。それを修正するために私は何ができますか?SQL Server 2008のXMLデータ型にUnicodeデータを格納
これは私のUPDATE文です:
update db_owner.Screen_Template set template_xml =
'<?xml version="1.0"?>
<Screen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../GUIGenerator_V2/Scheme/GG_Scheme.xsd">
<Legend EntityType="Request">
<Module ForceTabs="1">
<Events>
<Event Value="onafter_moduleinit_beforedraw()" Type="onafter_moduleinit_beforedraw"/>
</Events>
<Section Id="Header" Type="header" Caption="Header" ContainerCSS="background:#C1E0F4;border-bottom:2px groove;margin-bottom:3px;padding:10 3 3 3">
<Containers>
<Form Id="Header" Caption="General Details" Source="Request" Layout="Fixed">
<Layout>
<table cellaspacing="0" cellpadding="0">
<tr>
<td>
<ControlRef Id="Origin" ShowCaption="1"/>
</td>
<td>
<ControlRef Id="Type" ShowCaption="1"/>
</td>
<td>
<ControlRef Id="Process" ShowCaption="1"/>
</td>
<td width="20" align="center">
<span class="separator"/>
</td>
<td>
<ControlRef Id="FindBy" ShowCaption="1"/>
</td>
<td>
<ControlRef Id="Find"/>
</td>
<td>
<button width="30" onclick="doFindCustomer()">
<Caption Caption="GO"/>
</button>
</td>
</tr>
</table>
</Layout>
<Controls>
<Control Id="Origin" Caption="Origin" FieldName="Origin" DataType="string" Width="90" CaptionWidth="70" ReadOnly="1" Mandatory="1" Hidden="1"/>
<Control Id="Type" Caption="Type" FieldName="Type" DataType="select" Width="60" CaptionWidth="40" ReadOnly="1" Mandatory="1" DefaultValue="Service" Hidden="1">
<Member Value="Allert" Caption="Allert"/>
<Member Value="Service" Caption="Service"/>
<Member Value="Marketing" Caption="Marketing"/>
</Control>
<Control Id="Process" Caption="Process" FieldName="Process" DataType="string" Width="90" CaptionWidth="70" ReadOnly="1" Mandatory="1" Hidden="1"/>
<Control Id="FindBy" Caption="Find:" VCaption="Find By" FieldName="FindBy" DataType="select" Width="90" CaptionWidth="50" ReadOnly="0" Mandatory="0" CaptionCSS="font-weight:bold" DefaultValue="IMTSI">
<Member Value="IMTSI" Caption="IMTSI"/>
<Member Value="ID" Caption="ID"/>
</Control>
<Control Id="Find" Caption="Find Value" FieldName="Find" DataType="string" Width="90" CaptionWidth="60" ReadOnly="0" Mandatory="0" CaptionCSS="font-weight:bold"/>
</Controls>
</Form>
</Containers>
</Section>
<Section Id="1" Type="page" Caption="tech visit sms reminder">
<Containers>
<Form Id="General" Caption="General Details" Source="Request" Layout="Fixed">
<Controls>
<Control Id="IMTSI" Caption="IMTSI" Source="Param[@Name = ''IMTSI'']" FieldName="Value" DataType="string" Width="120" CaptionWidth="120" BreakAfter="1" Mandatory="0" Hidden="1"/>
<Control Id="MessageType" Caption="Message Type" Source="Param[@Name = ''MessageType'']" FieldName="Value" DataType="select" Width="150" CaptionWidth="120" ReadOnly="1" Mandatory="1" DefaultValue="Allert" Action="handleMessageTypeChange()" BreakAfter="1">
<Member Value="SMS" Caption="SMS"/>
<Member Value="EMAIL" Caption="EMAIL"/>
<Member Value="ATOS" Caption="ATOS"/>
<Member Value="SELF SERVICE" Caption="SELF SERVICE"/>
</Control>
<Control Id="Language" Caption="Language" Source="Param[@Name = ''Language'']" FieldName="Value" DataType="select" Width="120" CaptionWidth="120" ReadOnly="0" BreakAfter="1" SelectionType="single" Hidden="0" SeparateAfter="1">
<Member Value="heb" Caption="heb"/>
<Member Value="eng" Caption="eng"/>
</Control>
<Control Id="Mobile" Caption="Mobile" Source="Param[@Name = ''Mobile'']" FieldName="Value" DataType="string" Width="120" CaptionWidth="120" BreakAfter="1" Mandatory="1" SeparateAfter="0"/>
<Control Id="FirstName" Caption="First Name" Source="Param[@Name = ''FirstName'']" FieldName="Value" DataType="string" Width="120" BreakAfter="1" CaptionWidth="120" Mandatory="1"/>
<Control Id="Visitday" Caption="Visit day" Source="Param[@Name = ''Visitday'']" FieldName="Value" DataType="select" Width="120" CaptionWidth="120" ReadOnly="0" BreakAfter="1" Mandatory="1" SeparateBefore="1" SeparateAfter="1">
<Member Value="א" Caption="ראשון"/>
<Member Value="ב" Caption="שני"/>
<Member Value="ג" Caption="שלישי"/>
<Member Value="ד" Caption="רביעי"/>
<Member Value="ה" Caption="חמישי"/>
</Control>
<Control Id="Date" Caption="Visit date" Source="Param[@Name = ''Date'']" FieldName="Value" DataType="date" EnableTime="0" Width="120" CaptionWidth="120" Height="60" BreakAfter="1" MaxLen="20" Mandatory="1" SeparateBefore="1" SeparateAfter="1"/>
<Control Id="Visithours" Caption="Visit hours" Source="Param[@Name = ''Visithours'']" FieldName="Value" DataType="string" EnableTime="1" Width="120" CaptionWidth="120" Height="60" BreakAfter="1" MaxLen="20" Mandatory="1" SeparateBefore="1" SeparateAfter="1"/>
<Control Id="Email" Caption="Email" Source="Param[@Name = ''Email'']" FieldName="Value" DataType="string" Width="350" CaptionWidth="120" BreakAfter="1" Mandatory="0" Hidden="1"/>
<Control Id="Subject" Caption="Subject" Source="Param[@Name = ''Subject'']" FieldName="Value" DataType="string" Width="350" CaptionWidth="120" BreakAfter="1" MaxLen="40" Hidden="1"/>
<Control Id="Sender" Caption="Sender" Source="Param[@Name = ''Sender'']" FieldName="Value" DataType="string" Width="350" CaptionWidth="120" ReadOnly="1" BreakAfter="1"/>
<Control Id="Priority" Caption="Priority" Source="Param[@Name = ''Priority'']" FieldName="Value" DataType="select" Width="350" CaptionWidth="120" BreakAfter="1" DefaultValue="LOW" Hidden="1">
<Member Value="LOW" Caption="Low" Glyf="../../GUIGenerator_V2/assets/themes/Images/flag_blue.png"/>
<Member Value="MED" Caption="Medium" Glyf="../../GUIGenerator_V2/assets/themes/Images/flag_yellow.png"/>
<Member Value="HIGH" Caption="High" Glyf="../../GUIGenerator_V2/assets/themes/Images/flag_red.png"/>
</Control>
</Controls>
</Form>
</Containers>
</Section>
</Module>
<DefaultData>
<Request Origin="ISRAEL" Type="Service" Process="17">
<Param Name="MessageType" Type="Field" Value="SMS"/>
<Param Name="FirstName" Type="Field"/>
<Param Name="Visitday" Type="Field"/>
<Param Name="Date" Type="Field"/>
<Param Name="Visithours" Type="Field"/>
<Param Name="Mobile" Type="Field"/>
<Param Name="Sender" Type="Field" Value="BTP|*5755"/>
<Param Name="Priority" Type="Field" Value="LOW"/>
<Param Name="Language" Type="Field" Value="heb"/>
</Request>
</DefaultData>
</Legend>
<Data/>
</Screen>'
where UID like '4'
とSELECT文:
SELECT * FROM Screen_Template WHERE env LIKE '" + env + "' AND OpCo LIKE '" + opco + "' AND UID LIKE '" + uid + "'"
XMLデータ型は、すべてがUCS-2ユニコード(1文字あたり2バイト)で保存されるため、基本的にヘブライ語文字をうまく処理できるはずです。どのように**そのXML列にデータを挿入**しましたか? –
update文を使用することで、xmlテキストの前に 'N'を追加しようとしましたが、それでもすべてのヘブライ文字を '?'に変更しました。 – user1176926
何が問題だと思われますか? – user1176926