そのような列は約 100 あります。現在、ブロブの 1 つの列は次のようになっています。
<GridDataVisibleColumn>
<FilterBehavior>StronglyTyped</FilterBehavior>
<FilterBarMode>Immediate</FilterBarMode>
<AllowFilter>false</AllowFilter>
<AllowSort>true</AllowSort>
<AllowDrag>false</AllowDrag>
<AllowGroup>true</AllowGroup>
<AllowResize>true</AllowResize>
<ShowColumnOptions>false</ShowColumnOptions>
<HeaderText>XRef</HeaderText>
<IncrementSeed>1</IncrementSeed>
<IsIdentity>false</IsIdentity>
<IsReadOnly>false</IsReadOnly>
<MappingName>XRef</MappingName>
<MinimumWidth>0</MinimumWidth>
<Width>
<UnitType>None</UnitType>
<Value>150</Value>
</Width>
<DataType>String</DataType>
<UpdateMode>LostFocus</UpdateMode>
<IsHidden>false</IsHidden>
</GridDataVisibleColumn>
SQL クエリは次のようになります。
exec sp_xml_preparedocument @hdoc OUTPUT、@blobXML
insert into @tmpblob
(
RunDate,
Token,
OwnerId,
MappingName ,
HeaderText ,
WidthUnitType,
WidthValue
)
select
@RunDate,
@Token,
@OwnerId,
MappingName,
HeaderText,
WidthUnitType,
WidthValue
from OPENXML(@hdoc, '/GridDataTableProperties/VisibleColumns/GridDataVisibleColumn/MappingName', 2)
with(
MappingName VARCHAR (64) './text()' ,
HeaderText VARCHAR (64) './text()' ,
WidthUnitType VARCHAR (64) './UnitType/text()' ,
WidthValue VARCHAR (64) './Value/text()'
)
EXEC sp_xml_removedocument @hdoc
@tmpblob ですべてが正しいと仮定してください。それも投稿できますが、それではコンシーになりません。このxmlを次のような表の形式で表示する方法を知りたい
MappingName HeaderText WidthUnitType WidthValue
XRef XRef なし 150