SQLServer2000andXMLErikVeermanConsultantIntellinetBusinessIntelligenceObjectivesGiveanoverviewonthenewXMLcapabilitiesinSQLServer2000DemonstrateratherthanpresentProvidebaseknowledgefor…XMLarchitecturedecisionsResearchstartingpointsProsandconsofparallelXMLtechnologyimplementationsDatainteractionleveragingSQL'sXMLcapabilitiesAgendaTheabilitytoretrieveandwriteXMLdata:RetrieveXMLdatausingtheSELECTstatementandtheFORXMLclause.
WriteXMLdatausingOPENXMLrowsetprovider.
TheabilitytoaccessSQLServerusingHTTP.
IISConfigurationTemplateQueriesXSLStylesheetsAgendaSupportforXDRschemas/XMLViewsXPathqueriesagainsttheseschemas.
XMLforSQLWebReleaseBulkLoadUpdategramADOprogrammingmethods(ChrisHagen)XMLinuse(ChrisHagen)Agenda:SQLServer2000XMLSELECTHowhasSQLServerextendedtheSELECTparadigmtosupportXMLSELECTStatementSyntax:SELECT………FORXML{RAW|AUTO|EXPLICIT}[,XMLDATA][,ELEMENTS][,BINARYBase64]SimpleXMLQuery:SELECToh.
CustomerID,oh.
OrderId,od.
ProductID,od.
UnitPrice,od.
QuantityFROMOrdersohINNERJOIN[OrderDetails]odONoh.
orderid=od.
orderidFORXML{RAW|AUTO}FORXMLRAWFormatTakesthequeryresultandtransformseachrowintheresultsetintoanXMLelementwithagenericidentifierastheelementtag.
FORXMLAUTOFormatReturnsqueryresultsinasimple,nestedXMLtree.
EachtableintheFROMclauseforwhichatleastonecolumnislistedintheSELECTclauseisrepresentedasanXMLelement.
ThecolumnslistedintheSELECTclausearemappedtotheappropriateelementattributes.
FORXMLEXPLICITFormatBasedontheconceptofaUniversalTablecontainingalltheinformationabouttheresultingXMLtree.
ContainsTagandParentmeta-dataTag:TagnumberofcurrentelementParent:TagnumberofparentelementColumnnamesareXMLGenericidentifiers.
Identifier!
TagNumber!
AttributeNameEXPLICITSampleQuerySELECT1ASTag,NULLASParent,oh.
CustomerID[Order!
1!
CustomerID],oh.
OrderId[Order!
1!
OrderId],NULL[OrderDetail!
2!
ProductId],NULL[OrderDetail!
2!
UnitPrice],NULL[OrderDetail!
2!
Quantity]FROMOrdersohWHEREoh.
CustomerId='ANTON'UNIONALLSELECT2,1,oh.
CustomerID,oh.
OrderId,od.
ProductID,od.
UnitPrice,od.
QuantityFROMOrdersohINNERJOIN[OrderDetails]odONoh.
orderid=od.
orderidWHERECustomerId='ANTON'ORDERBY[Order!
1!
CustomerID],[Order!
1!
OrderId],[OrderDetail!
2!
ProductId]FORXMLEXPLICITSELECTXMLFormatsDEMOAgenda:SQLServer2000OpenXMLAllowsonetoparseandutilizeanXMLdocumentOpenXMLProcessInputanXMLdocumentProcessaninternalrepresentationexecsp_xml_preparedocumentParsetheXMLdocumentOpenXMLRowsetfunctionRemoveinternalrepresentationfrommemoryEXECsp_xml_removedocumentOpenXMLProcessOpenXMLSyntaxOPENXML(idocint[in],rowpatternnvarchar[in],[flagsbyte[in]])[WITH(SchemaDeclaration|TableName)]OpenXMLProcessDEMOAgenda:SQLServer2000IISIntegrationHowdoesoneuseIISforretrievingXMLdata.
UsingIIS,theprocess.
ConfigureanIISVirtualRootDefinetemplatequeriesDefinestylesheetsMakeHTTPrequestConfigureanIISVirtualRootDEMOHTTPAccesstoDataURLQueryhttp://sqlserver/vrootparametersParametersSql=SELECT+*+FROM+Sku+FOR+XML+RAWEncoding=UTF-8Root=rootHTTPAccesstoDataDirectQueryGoodforasingleselectofasinglecolumnValueisreturnedinnativeformat,notXMLEnablesdirectretrievalofobjectslikeimages,OLEobjects,etc.
http://sqlserver/vroot/dbobject/xpathWhatareTemplateQueriesTheseareXMLdocumentsthatdefinequeriesCanbebounddirectlytoStyleSheetsCalledbyreferencingtheXMLdocumentintheURLWhatareTemplateQueriesTemplatehttp://sqlserver/vroot/vnameparamsVnameisacompletepathtothetemplateXMLfileParametersmaybexsl,encoding,orcontenttype;oruserdefined.
ProvidesaneasywaytoperformcomplexquerieswithlittlenetworktrafficWhyuseTemplateQueriesCanusedynamicSQLbutnorestrictionsonwhatisexecutedAutomaticformattingoftheXMLheaderinformationTemplatessimplifytheHTTPrequestTemplateshavebettersupportparametersDefineandUseStyleSheetsCanbeaddedtotheURLXSL=stylesheet.
xslContentType=text/htmlCanbedefinedintheTemplateWhatdoesatemplatequerylooklikeandhowisitrunDEMOAgenda:XMLXDRSchemaXMLViews|UpdategramMappingrelationaldatathroughanXMLschemaWhatisanXMLViewDefinesanXML-formattedviewonthedatabaseAnnotationsspecifytheXMLtorelationaldatabasemappingforcolumnvaluesandrelationshipsUsesXpathtoquerytheXMLViewHowtouseXMLViewshttp://server/vroot/vname/xpathparametersVnameisadirectreferencetotheschemafileXpathisthexpathqueryParametersmaybexsl,encoding,contenttype,oruserdefinedHowdoIselectdatafromanXMLViewDEMOXMLforSQLWebReleaseXMLforSQLWebRelease1UpdateGramsBulkLoadXMLsupportXMLforSQLWebRelease2(July2001)XMLViewswithXSDSupportforDiffGramsClientSideXMLformattingUpdategramSchemamapping,UpdategramsyntaxInserts,Updates,DeletesUsingandblocksPassingParametersWritingDatawithUpdateGramsUpdategrams(example)MiscellaneousDataRetreival:OLAPdatasp_makewebsqlDEMOAgenda:ADOProgrammingMethodsforSQLServer2000XMLHowdoesonewritecomponentsutilizingthenewSELECTFORXMLandIISUtilizeADOFunctionalityCallsmadethroughADOCommandUsesADOStreamObjectRequiresADO2.
6StreamObjectdefinedasapropertyoftheCommandObjectXMLDataplacedintheStreamObjectObtainedusingReadTextADOsupportsXMLRecordsetscanbepersistedtoXMLFileStreamObjectDOMIntegrationIIS5ResponseObjectAlsosupportforADTGAdvancedDataTableGramformatSupportHierarchicalRecordsetsADOXMLStreamSupportCanpersistdirectlytoanADOStreamObjectXMLextractedusingStreamReadTextXMLdatacanthenbeutilizedinmemoryPassXMLbacktoclientTransformtoHTMLusingXSLADOandDOMIntegrationCanpersistXMLdirectlyintotheXMLDOMDocumentRecordset.
SaveMSXML.
DOMDocument,adPersistXMLCanperformdirectXSLtransformforHTMLbasedcomponentsADOandIIS5ResponseResponseObjectexposesandIStreamInterfaceRecordset.
SaveResponse,adPersistXMLDisplaysXMLinbrowserAvoidsexpensivediskoperationsADOXMLProgrammingDEMOForfurtherInformationXMLwebsitehttp://msdn.
microsoft.
com/xmlSQLServer2000andIIShttp://msdn.
microsoft.
com/msdnmag/issues/0300/sql/sql.
aspSQLServer2000http://www.
microsoft.
com/sqlADOhttp://www.
microsoft.
com/adoFeedback/Questions
硅云怎么样?硅云是一家专业的云服务商,硅云的主营产品包括域名和服务器,其中香港云服务器、香港云虚拟主机是非常受欢迎的产品。硅云香港可用区接入了中国电信CN2 GIA、中国联通直连、中国移动直连、HGC、NTT、COGENT、PCCW在内的数十家优质的全球顶级运营商,是为数不多的多线香港云服务商之一。目前,硅云香港云服务器,CN2+BGP线路,1核1G香港云主机仅188元/年起,域名无需备案,支持个...
RAKsmart发布了新年钜惠活动,即日起到2月28日,商家每天推出限量服务器秒杀,美国服务器每月30美元起,新上了韩国服务器、GPU服务器、香港/日本/美国常规+站群服务器、1-10Gbps不限流量大带宽服务器等大量库存;VPS主机全场提供7折优惠码,同时针对部分特惠套餐无码直购每月仅1.99美元,支持使用PayPal或者支付宝等方式付款,有中英文网页及客服支持。爆款秒杀10台/天可选精品网/大...
数脉科技(shuhost)8月促销:香港独立服务器,自营BGP、CN2+BGP、阿里云线路,新客立减400港币/月,老用户按照优惠码减免!香港服务器带宽可选10Mbps、30Mbps、50Mbps、100Mbps带宽,支持中文本Windows、Linux等系统。数脉香港特价阿里云10MbpsCN2,e3-1230v2,16G内存,1T HDD 或 240G SSD,10Mbps带宽,IPv41个,...
sqlserver2000挂起为你推荐
操作httpcss加载失败网易邮箱登陆显示CSS加载失败,怎么办?急,在线等。dell服务器bios设置戴尔服务器720bios设置硬盘启动verticalflash开心001开心001与开心网怎么不一样,哪个是真的?加多宝和王老吉王老吉和加多宝的区别中国保健养猪网猪场基本保健包括哪些方面?申请400电话400电话如何申请?kingcmsKingcms 怎么解决会员登录页面的问题帝国cms教程如何使用帝国CMS模板
郑州虚拟主机 最新代理服务器地址 主机评测 webhostingpad tier vmsnap3 godaddy支付宝 创宇云 win8.1企业版升级win10 美国php空间 轻量 南通服务器 空间技术网 昆明蜗牛家 上海联通宽带测速 上海电信测速网站 外贸空间 秒杀品 新加坡空间 lamp的音标 更多