<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>VSDOTNET - SQL-Server 2005</title>
    <link>http://www.vsdotnet.ch/</link>
    <description>Un peu de mon expérience dans le monde .NET</description>
    <language>en-us</language>
    <copyright>Stéphane Schwartz</copyright>
    <lastBuildDate>Thu, 17 Dec 2009 15:44:32 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>stephane@vsdotnet.ch</managingEditor>
    <webMaster>stephane@vsdotnet.ch</webMaster>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=918719e6-a1b9-47c8-909a-7333893aec5c</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,918719e6-a1b9-47c8-909a-7333893aec5c.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,918719e6-a1b9-47c8-909a-7333893aec5c.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=918719e6-a1b9-47c8-909a-7333893aec5c</wfw:commentRss>
      <title>Interrogation du schéma d’une instance de DB</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,918719e6-a1b9-47c8-909a-7333893aec5c.aspx</guid>
      <link>http://www.vsdotnet.ch/2009/12/17/InterrogationDuSch%c3%a9maDuneInstanceDeDB.aspx</link>
      <pubDate>Thu, 17 Dec 2009 15:44:32 GMT</pubDate>
      <description>&lt;link rel="File-List" href="file:///C:%5CUsers%5CSCHWAR%7E1.OMS%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;
&lt;link rel="themeData" href="file:///C:%5CUsers%5CSCHWAR%7E1.OMS%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;
&lt;link rel="colorSchemeMapping" href="file:///C:%5CUsers%5CSCHWAR%7E1.OMS%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:TrackMoves/&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:HyphenationZone&gt;21&lt;/w:HyphenationZone&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;FR&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:DontVertAlignCellWithSp/&gt;
   &lt;w:DontBreakConstrainedForcedTables/&gt;
   &lt;w:DontVertAlignInTxbx/&gt;
   &lt;w:Word11KerningPairs/&gt;
   &lt;w:CachedColBalance/&gt;
  &lt;/w:Compatibility&gt;
  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val="Cambria Math"/&gt;
   &lt;m:brkBin m:val="before"/&gt;
   &lt;m:brkBinSub m:val="&amp;#45;-"/&gt;
   &lt;m:smallFrac m:val="off"/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val="0"/&gt;
   &lt;m:rMargin m:val="0"/&gt;
   &lt;m:defJc m:val="centerGroup"/&gt;
   &lt;m:wrapIndent m:val="1440"/&gt;
   &lt;m:intLim m:val="subSup"/&gt;
   &lt;m:naryLim m:val="undOvr"/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
  DefSemiHidden="true" DefQFormat="false" DefPriority="99"
  LatentStyleCount="267"&gt;
  &lt;w:LsdException Locked="false" Priority="0" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Normal"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="heading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 7"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 8"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" Name="toc 9"/&gt;
  &lt;w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/&gt;
  &lt;w:LsdException Locked="false" Priority="10" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/&gt;
  &lt;w:LsdException Locked="false" Priority="11" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/&gt;
  &lt;w:LsdException Locked="false" Priority="22" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Strong"/&gt;
  &lt;w:LsdException Locked="false" Priority="20" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="59" SemiHidden="false"
   UnhideWhenUsed="false" Name="Table Grid"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/&gt;
  &lt;w:LsdException Locked="false" Priority="1" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/&gt;
  &lt;w:LsdException Locked="false" Priority="34" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/&gt;
  &lt;w:LsdException Locked="false" Priority="29" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="30" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/&gt;
  &lt;w:LsdException Locked="false" Priority="60" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="61" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="62" SemiHidden="false"
   UnhideWhenUsed="false" Name="Light Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="63" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="64" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="65" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="66" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="67" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="68" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="69" SemiHidden="false"
   UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="70" SemiHidden="false"
   UnhideWhenUsed="false" Name="Dark List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="71" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="72" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful List Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="73" SemiHidden="false"
   UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/&gt;
  &lt;w:LsdException Locked="false" Priority="19" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="21" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/&gt;
  &lt;w:LsdException Locked="false" Priority="31" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="32" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/&gt;
  &lt;w:LsdException Locked="false" Priority="33" SemiHidden="false"
   UnhideWhenUsed="false" QFormat="true" Name="Book Title"/&gt;
  &lt;w:LsdException Locked="false" Priority="37" Name="Bibliography"/&gt;
  &lt;w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;style&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:roman;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1107304683 0 0 159 0;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1610611985 1073750139 0 0 159 0;}
@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;
	mso-font-charset:0;
	mso-generic-font-family:modern;
	mso-font-pitch:fixed;
	mso-font-signature:-1610611985 1073750091 0 0 159 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-parent:"";
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:10.0pt;
	margin-left:0cm;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:10.0pt;
	margin-left:36.0pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:0cm;
	margin-left:36.0pt;
	margin-bottom:.0001pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast
	{mso-style-priority:34;
	mso-style-unhide:no;
	mso-style-qformat:yes;
	mso-style-type:export-only;
	margin-top:0cm;
	margin-right:0cm;
	margin-bottom:10.0pt;
	margin-left:36.0pt;
	mso-add-space:auto;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-font-family:Calibri;
	mso-bidi-font-family:"Times New Roman";
	mso-fareast-language:EN-US;}
.MsoChpDefault
	{mso-style-type:export-only;
	mso-default-props:yes;
	font-size:10.0pt;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	mso-ascii-font-family:Calibri;
	mso-fareast-font-family:Calibri;
	mso-hansi-font-family:Calibri;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;
	mso-header-margin:36.0pt;
	mso-footer-margin:36.0pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:924995673;
	mso-list-type:hybrid;
	mso-list-template-ids:361020916 67895313 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l0:level1
	{mso-level-text:"%1\)";
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
@list l1
	{mso-list-id:2028017992;
	mso-list-type:hybrid;
	mso-list-template-ids:361020916 67895313 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l1:level1
	{mso-level-text:"%1\)";
	mso-level-tab-stop:none;
	mso-level-number-position:left;
	text-indent:-18.0pt;}
ol
	{margin-bottom:0cm;}
ul
	{margin-bottom:0cm;}
--&gt;
&lt;/style&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Tableau Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Calibri","sans-serif";}
&lt;/style&gt;
&lt;![endif]--&gt;&lt;font size="2"&gt;MS
a introduit, avec SQL-Server 2005 et les schémas de DB, de nouveaux vecteurs d’interrogation
de la structure d’une instance de DB. Voici un petit état de lieu.&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;h4&gt;&lt;font size="2"&gt;Les vues aux normes SQL2&lt;/font&gt;
&lt;/h4&gt;
&lt;font size="2"&gt;Chaque instance est dorénavant affublée d’un nouveau schéma : INFORMATION_SCHEMA.
Il permet d’interroger les informations en utilisant un point d’entrée central, puis
en spécifiant l’information recherchée (tables, views, routines, ..), avec une syntaxe
« utilisateur »&lt;br&gt;
&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;
&lt;br&gt;
SELECT&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br&gt;
FROM&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; INFORMATION_SCHEMA.TABLES&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;h4&gt;&lt;font size="2"&gt;Les vues systèmes (DMV Dynamic Management Views)&lt;/font&gt;
&lt;/h4&gt;
&lt;font size="2"&gt;Un deuxième schéma est automatiquement ajouté à chaque instance : SYS.
L’interrogation se fait via des vues fournies par MS. Le niveau d’abstraction est
moindre, mais ne nombre d’informations accessibles est supérieur. 
&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br&gt;
FROM&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SYS.OBJECTS T1&lt;br&gt;
WHERE&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; T1.type = ‘U’&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;h4&gt;&lt;font size="2"&gt;Les procédures stockées spécialisées&lt;/font&gt;
&lt;/h4&gt;
&lt;font size="2"&gt;MS fournit un certain nombre de procédures stockés permettant d’interroger
les informations, tels que sp_tables, sp_columns, …&lt;br&gt;
&lt;font color="#0000ff"&gt;
&lt;br&gt;
EXEC sp_tables&lt;/font&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;h4&gt;&lt;font size="2"&gt;Les tables systèmes&lt;/font&gt;
&lt;/h4&gt;
&lt;font size="2"&gt;L’interrogation se fait cette fois au niveau le plus bas disponible.
Les données sont brutes et relativement difficile à interpréter …&lt;br&gt;
&lt;font color="#0000ff"&gt;
&lt;br&gt;
SELECT&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br&gt;
FROM&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; SYSOBJECTS T1&lt;br&gt;
WHERE&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; T1.type = ‘U’&lt;/font&gt;
&lt;br&gt;
&lt;/font&gt;
&lt;h4&gt;&lt;font size="2"&gt;Conclusion&lt;/font&gt;
&lt;/h4&gt;
&lt;font size="2"&gt;Les quatre méthodes de query de l’information retournent le même résultat,
soit la liste des tables d’une DB.&amp;nbsp; Mais alors quelle méthode utiliser en priorité
? La réponse, et l’explication est relativement simple :&lt;br&gt;
1)&amp;nbsp;&amp;nbsp;&amp;nbsp; Les vues aux normes SQL2&lt;br&gt;
2)&amp;nbsp;&amp;nbsp;&amp;nbsp; Les vues systèmes (DMV Dynamic Management Views)&lt;br&gt;
3)&amp;nbsp;&amp;nbsp;&amp;nbsp; Les procédures stockées spécialisées&lt;br&gt;
4)&amp;nbsp;&amp;nbsp;&amp;nbsp; Les tables systèmes&lt;br&gt;
Et pourquoi ?&lt;br&gt;
1)&amp;nbsp;&amp;nbsp;&amp;nbsp; Vous l’aurez compris, chaque niveau encapsule le niveau suivant.&amp;nbsp;
Les vues aux normes SQL2 sont donc plus faciles à utiliser car elles « cachent » la
complexité&amp;nbsp; du bas niveau.&lt;br&gt;
2)&amp;nbsp;&amp;nbsp;&amp;nbsp; Seuls les vues et les SPs sont compatibles de version en version.
Il est donc&amp;nbsp; évident de les préférer pour des raisons de compatibilité.&lt;br&gt;
&lt;/font&gt;&lt;span style="" lang="FR-CH"&gt;&lt;font size="2"&gt;&lt;/font&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=918719e6-a1b9-47c8-909a-7333893aec5c" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,918719e6-a1b9-47c8-909a-7333893aec5c.aspx</comments>
      <category>SQL-Server </category>
      <category>SQL-Server 2005</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=c4456a56-0570-4f2e-a895-f79ec2bf64c5</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,c4456a56-0570-4f2e-a895-f79ec2bf64c5.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,c4456a56-0570-4f2e-a895-f79ec2bf64c5.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=c4456a56-0570-4f2e-a895-f79ec2bf64c5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://msdn.microsoft.com/fr-fr/library/bb386947.aspx">Un article msdn</a> expliquant
le mappage utilisé par LINQ entre les types SQL et CLR. 
</p>
        <p>
La partie la plus intéressant reste la matrice montrant quels types SQL est compatible
avec quels type CLR. Le mappage n'est évidement pas de type 1:1.
</p>
        <p align="center">
          <img src="http://www.vsdotnet.ch/content/binary/SQLtoCLR.jpg" border="0" />
        </p>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=c4456a56-0570-4f2e-a895-f79ec2bf64c5" />
      </body>
      <title>Mappage des types SQL et CLR (LINQ)</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,c4456a56-0570-4f2e-a895-f79ec2bf64c5.aspx</guid>
      <link>http://www.vsdotnet.ch/2009/02/24/MappageDesTypesSQLEtCLRLINQ.aspx</link>
      <pubDate>Tue, 24 Feb 2009 12:51:08 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://msdn.microsoft.com/fr-fr/library/bb386947.aspx"&gt;Un article msdn&lt;/a&gt; expliquant
le mappage utilisé par LINQ entre les types SQL et CLR. 
&lt;/p&gt;
&lt;p&gt;
La partie la plus intéressant reste la matrice montrant quels types SQL est compatible
avec quels type CLR. Le mappage n'est évidement pas de type 1:1.
&lt;/p&gt;
&lt;p align=center&gt;
&lt;img src="http://www.vsdotnet.ch/content/binary/SQLtoCLR.jpg" border=0&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=c4456a56-0570-4f2e-a895-f79ec2bf64c5" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,c4456a56-0570-4f2e-a895-f79ec2bf64c5.aspx</comments>
      <category>.NET 3.5</category>
      <category>LINQ</category>
      <category>SQL-Server </category>
      <category>SQL-Server 2005</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=1f6a9057-6909-4259-b0bc-8a26282071f2</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,1f6a9057-6909-4259-b0bc-8a26282071f2.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,1f6a9057-6909-4259-b0bc-8a26282071f2.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=1f6a9057-6909-4259-b0bc-8a26282071f2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Récement, j'ai experimenté quelqeus soucis avec un POC Merge Replication :
</p>
        <p>
          <strong>80004005 : Failure to connect to SQL Server</strong>
        </p>
        <p>
Le Merge Replication n’abouti pas. L’erreur ‘OpenDB failed getting pub version 28627’
est loguée dans le fichier SQLCESA30.LOG.
</p>
        <p>
Liste des contrôles à effectuer :
</p>
        <ul>
          <li>
S’assurer que le serveur de réplication fonctionne correctement :<br /><a href="http://nomduserveur/ssce/sqlcesa30.dll?diag">http://nomduserveur/ssce/sqlcesa30.dll?diag</a></li>
          <li>
Contrôler dans le fichier log (C:\Program Files\Microsoft SQL Server 2005 Mobile Edition\Server\SSCE\SQLCESA30.LOG)
que l’entrée ‘Hr=00000000 SQLCESA30.DLL loaded 0’</li>
        </ul>
        <p>
Vérifier le transport en effectuant des ‘ping’ entre Publisher, Distributor &amp;Replication.
</p>
        <ul>
          <li>
Si un des serveur ne répond pas, vérifier que le firewall est à off.</li>
        </ul>
        <p>
Vérifier que les différents serveurs (Publisher, Distributor &amp; Replication) communiquent
correctement :
</p>
        <ul>
          <li>
depuis le serveur de réplication :<br />
o osql –S PUBLISHER –E<br />
o osql –S DISTRIBUTOR –E</li>
          <li>
etc sur les autres serveurs ...</li>
        </ul>
        <p>
Si la communication ne fonctionne pas, vérifier dans ‘SQL Server Surface Area Configuration’
que les connections locales et distantes sont autorisées.
</p>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=1f6a9057-6909-4259-b0bc-8a26282071f2" />
      </body>
      <title>Troubleshhoting problèmes avec Merge Replication</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,1f6a9057-6909-4259-b0bc-8a26282071f2.aspx</guid>
      <link>http://www.vsdotnet.ch/2008/01/30/TroubleshhotingProbl%c3%a8mesAvecMergeReplication.aspx</link>
      <pubDate>Wed, 30 Jan 2008 15:43:54 GMT</pubDate>
      <description>&lt;p&gt;
Récement, j'ai experimenté quelqeus soucis avec un POC Merge Replication :
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;80004005 : Failure to connect to SQL Server&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Le Merge Replication n’abouti pas. L’erreur ‘OpenDB failed getting pub version 28627’
est loguée dans le fichier SQLCESA30.LOG.
&lt;/p&gt;
&lt;p&gt;
Liste des contrôles à effectuer :
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
S’assurer que le serveur de réplication fonctionne correctement :&lt;br&gt;
&lt;a href="http://nomduserveur/ssce/sqlcesa30.dll?diag"&gt;http://nomduserveur/ssce/sqlcesa30.dll?diag&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
Contrôler dans le fichier log (C:\Program Files\Microsoft SQL Server 2005 Mobile Edition\Server\SSCE\SQLCESA30.LOG)
que l’entrée ‘Hr=00000000 SQLCESA30.DLL loaded 0’&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Vérifier le transport en effectuant des ‘ping’ entre Publisher, Distributor &amp;amp;Replication.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Si un des serveur ne répond pas, vérifier que le firewall est à off.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Vérifier que les différents serveurs (Publisher, Distributor &amp;amp; Replication) communiquent
correctement :
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
depuis le serveur de réplication :&lt;br&gt;
o&amp;nbsp;osql –S PUBLISHER –E&lt;br&gt;
o&amp;nbsp;osql –S DISTRIBUTOR –E&lt;/li&gt;
&lt;li&gt;
etc sur les autres serveurs ...&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Si la communication ne fonctionne pas, vérifier dans ‘SQL Server Surface Area Configuration’
que les connections locales et distantes sont autorisées.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=1f6a9057-6909-4259-b0bc-8a26282071f2" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,1f6a9057-6909-4259-b0bc-8a26282071f2.aspx</comments>
      <category>Merge Replication</category>
      <category>SQL-Server 2005</category>
      <category>Windows Mobile</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=40ecc2b3-7e7f-46de-8982-ae0ef067dd69</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,40ecc2b3-7e7f-46de-8982-ae0ef067dd69.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,40ecc2b3-7e7f-46de-8982-ae0ef067dd69.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=40ecc2b3-7e7f-46de-8982-ae0ef067dd69</wfw:commentRss>
      <title>SQL-Server et changement du nom de machine</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,40ecc2b3-7e7f-46de-8982-ae0ef067dd69.aspx</guid>
      <link>http://www.vsdotnet.ch/2008/01/24/SQLServerEtChangementDuNomDeMachine.aspx</link>
      <pubDate>Thu, 24 Jan 2008 13:36:14 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Dans le cadre d’un POC (Proof Of
Concept), j’ai décidé de changer le nom du serveur de base de donnée afin que ce laboratoire
soit ‘auto-documenté’ (c’est plus claire quand les machines s’appellent ‘Directory
Services’, ‘Publisher’ au lien de ‘WIN-1234’ et ‘WIN-1235 …). Cette modification intervient
APRES l’installation de SQL-Server.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Le changement de nom s’effectue
très simplement depuis l’administration de l’ordinateur (Poste de travail/ Gérer).
Jusqu’ici, tout va bien.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Lors de la première connexion à
la base de donnée via SQL-Server Management Studio, la mire propose toujours l’ancien
nom de l’ordinateur. Pas de souci, il suffit de remplacer celui-ci par son nouveau
nom et la connexion s’effectue correctement.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Un problème survient lorsque l’on
désir gérer la réplication. En effet, pour une mystérieuse raison, la réplication
(Replication.Utilities) cherche toujours à accéder au serveur avec l’ancien nom …&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt" align=center&gt;
&lt;img style="WIDTH: 530px; HEIGHT: 156px" height=110 src="http://www.vsdotnet.ch/content/binary/Replication.jpg" width=508 border=0&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Un rapide coup d’œil sur les tables
système permet de trouver la source du souci&amp;nbsp;:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial color=#000000 size=3&gt;select * from sys.servers&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Retourne des informations
du serveur SGDB, et retourne surtout dans la colonne&amp;nbsp;‘NAME’ l’ancien nom de la
machine&amp;nbsp;&lt;/font&gt;&lt;span style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;L&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Le souci sera rapidement résolut
en supprimant le serveur et en le recréant à l’aide des procédures stockées suivantes&amp;nbsp;:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial color=#000000 size=3&gt;sp_dropserver ‘WIN-1235’&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font face=Arial color=#000000 size=3&gt;sp_addserver @server=‘Publisher’, @local=’local’&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: FR; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR; mso-bidi-language: AR-SA"&gt;&lt;font color=#000000&gt;Et
tout rentre dans l’ordre.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=40ecc2b3-7e7f-46de-8982-ae0ef067dd69" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,40ecc2b3-7e7f-46de-8982-ae0ef067dd69.aspx</comments>
      <category>SQL-Server 2005</category>
      <category>Tips</category>
      <category>Merge Replication</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=166cdf00-a113-428a-aac3-d1a6782fc3f4</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,166cdf00-a113-428a-aac3-d1a6782fc3f4.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,166cdf00-a113-428a-aac3-d1a6782fc3f4.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=166cdf00-a113-428a-aac3-d1a6782fc3f4</wfw:commentRss>
      <title>Serveur lié SQL-Server 2005 64 Bit / Oracle 9 32 Bit</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,166cdf00-a113-428a-aac3-d1a6782fc3f4.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/11/13/ServeurLi%c3%a9SQLServer200564BitOracle932Bit.aspx</link>
      <pubDate>Tue, 13 Nov 2007 16:20:25 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Après quelques heures de recherche, voici la procédure à suivre
afin de créer un linked server sous SQL-Server 2005 sous Windows Server 2003 x64 Edition
et Oracle 9 sous Windows Server 2003 (32 Bit).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Par défaut, le provider pour Oracle ne se trouve pas dans l’Object
Explorer de SQL Server Management Studio ( Server/ Server Object / Linked Servers
/ Providers). N’installez pas le client 32 bit en espérant le voir apparaître. En
effet, SQL-Server étant 64 bit, seuls les providers 64 bit sont visibles …&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Le premier pas est donc d’installer le client Oracle 64 bit (soit
la version Oracle Database 10g Release 2 (10.2.0.1.0) for Microsoft Windows (x64))
et l’installer.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Il faut ensuite installer l’Oracle Data Access Componant (ODAC
pour les intimes), toujours en version 64 bit (Oracle10g Release 2 ODAC (64-bit) 10.2.0.3
for Windows x64)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Redémarrer SQL-Server afin de voir le provider dans la lise des
Providers (OraOLEDB.Oracle).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Configurer le provider afin d’autoriser l’inprocess (Server/ Server
Object / Linked Servers / Providers / OraOLEDB.Oracle / Properties)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Configuer le TNS si cela n’est déjà fait (Démarrer / programs
/ Oracle - ODACHome1 / Outils de configuration et de migration / Net Manager)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;On peut maintenant ajouter le server lié&amp;nbsp; (merci Chuck P):&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;EXEC sp_addlinkedserver&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;'tnsName',&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;'Oracle',&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;'OraOLEDB.Oracle',&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;'tnsName'&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;EXEC sp_addlinkedsrvlogin 'tnsName', false,null, 'username', 'password'&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Dernier écueil …&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Si
lors du test de cette nouvelle connexion, le serveur vous retourne le message suivant&amp;nbsp;:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;strong&gt;&lt;span lang=EN style="mso-ansi-language: EN"&gt;&lt;font color=#000000&gt;ORA-12705
- Invalid or Unknow NLS parameter value specified&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;strong&gt;&lt;span lang=EN style="FONT-WEIGHT: normal; mso-ansi-language: EN"&gt;&lt;font color=#000000&gt;Il
vous faut encore éditer la base de registre et changer les clé ‘NLS_LANG’ d’Oracle
et leurs assigner la valeur ‘AMERICAN_AMERICA.WE8ISO8859P1’ . Tout ceci est documenté
chez Oracle ici : &lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span lang=EN style="mso-ansi-language: EN"&gt;&lt;a href="http://www.orafaq.com/forum/?t=msg&amp;amp;th=9602/0/" target=_blank&gt;ora-12705
- Invalid or unknown NLS parameter value specified&lt;/a&gt;&lt;/span&gt;&lt;b&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;Voilà, j’espère que cela fera gagner du temps a certains …&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-ansi-language: FR; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: FR; mso-bidi-language: AR-SA"&gt;&lt;font face=Verdana color=#000000 size=2&gt;Stéphane.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=166cdf00-a113-428a-aac3-d1a6782fc3f4" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,166cdf00-a113-428a-aac3-d1a6782fc3f4.aspx</comments>
      <category>Linked Server</category>
      <category>Oracle</category>
      <category>SQL-Server 2005</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=d9fa6ce9-fb02-4bac-a9f4-9f41949068fb</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,d9fa6ce9-fb02-4bac-a9f4-9f41949068fb.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,d9fa6ce9-fb02-4bac-a9f4-9f41949068fb.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=d9fa6ce9-fb02-4bac-a9f4-9f41949068fb</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Requêtes ayant été les plus exécutées
</p>
        <p>
Les DMV sys.dm_exec_query_stats, en association avec sys.dm_exec_sql_text, permet
de connaître les requêtes ayant été les plus exécutées.
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TOP</span> 50    
        <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.execution_count),
        T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> sys.dm_exec_query_stats
T1 <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CROSS</span> APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2     <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">GROUP</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>         T1.plan_handle,
        T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ORDER</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>     <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.execution_count) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DESC</span></span>
        </pre>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=d9fa6ce9-fb02-4bac-a9f4-9f41949068fb" />
      </body>
      <title>SQL Tips #7</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,d9fa6ce9-fb02-4bac-a9f4-9f41949068fb.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/10/25/SQLTips7.aspx</link>
      <pubDate>Thu, 25 Oct 2007 09:50:55 GMT</pubDate>
      <description>&lt;p&gt;
Requêtes ayant été les plus exécutées
&lt;/p&gt;
&lt;p&gt;
Les DMV sys.dm_exec_query_stats, en association avec sys.dm_exec_sql_text, permet
de connaître les requêtes ayant été les plus exécutées.
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;TOP&lt;/span&gt; 50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.execution_count),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; sys.dm_exec_query_stats
T1 &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CROSS&lt;/span&gt; APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;GROUP&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.plan_handle,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ORDER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.execution_count) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;DESC&lt;/span&gt; &lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=d9fa6ce9-fb02-4bac-a9f4-9f41949068fb" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,d9fa6ce9-fb02-4bac-a9f4-9f41949068fb.aspx</comments>
      <category>SQL-Server 2005</category>
      <category>Tips</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=3097bdc6-8469-4a21-a247-679460498a25</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,3097bdc6-8469-4a21-a247-679460498a25.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,3097bdc6-8469-4a21-a247-679460498a25.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=3097bdc6-8469-4a21-a247-679460498a25</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Requêtes ayant consommées le plus de cycle I/O
</p>
        <p>
Les DMV sys.dm_exec_query_stats, en association avec sys.dm_exec_sql_text, permet
de connaître les requêtes ayant consommées le plus de cycle I/O.
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TOP</span> 50    
        <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.total_physical_reads
+ T1.total_logical_reads + T1.total_logical_writes),         T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> sys.dm_exec_query_stats
T1 <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CROSS</span> APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2     <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">GROUP</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>         T1.plan_handle,
        T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ORDER</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>     <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.total_physical_reads
+ T1.total_logical_reads + T1.total_logical_writes ) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DESC</span></span>
        </pre>
        <p>
 
</p>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=3097bdc6-8469-4a21-a247-679460498a25" />
      </body>
      <title>SQL Tips #6</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,3097bdc6-8469-4a21-a247-679460498a25.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/10/25/SQLTips6.aspx</link>
      <pubDate>Thu, 25 Oct 2007 09:49:40 GMT</pubDate>
      <description>&lt;p&gt;
Requêtes ayant consommées le plus de cycle I/O
&lt;/p&gt;
&lt;p&gt;
Les DMV sys.dm_exec_query_stats, en association avec sys.dm_exec_sql_text, permet
de connaître les requêtes ayant consommées le plus de cycle I/O.
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;TOP&lt;/span&gt; 50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.total_physical_reads
+ T1.total_logical_reads + T1.total_logical_writes), &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; sys.dm_exec_query_stats
T1 &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CROSS&lt;/span&gt; APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;GROUP&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.plan_handle,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ORDER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.total_physical_reads
+ T1.total_logical_reads + T1.total_logical_writes ) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;DESC&lt;/span&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=3097bdc6-8469-4a21-a247-679460498a25" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,3097bdc6-8469-4a21-a247-679460498a25.aspx</comments>
      <category>SQL-Server 2005</category>
      <category>Tips</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=5c61d405-bd2b-4fe9-957e-13aee8a76ce0</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,5c61d405-bd2b-4fe9-957e-13aee8a76ce0.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,5c61d405-bd2b-4fe9-957e-13aee8a76ce0.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=5c61d405-bd2b-4fe9-957e-13aee8a76ce0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Requêtes ayant consommées le plus de cycle CPU
</p>
        <p>
Les DMV sys.dm_exec_query_stats, en association avec sys.dm_exec_sql_text, permet
de connaître les requêtes ayant consommées le plus de cycle CPU.
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TOP</span> 50
    <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.total_worker_time),
    T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> sys.dm_exec_query_stats
T1 <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CROSS</span> APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2     <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">GROUP</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>         T1.plan_handle,
        T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ORDER</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>         <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.total_worker_time) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DESC</span></span>
        </pre>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=5c61d405-bd2b-4fe9-957e-13aee8a76ce0" />
      </body>
      <title>SQL Tips #5</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,5c61d405-bd2b-4fe9-957e-13aee8a76ce0.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/10/25/SQLTips5.aspx</link>
      <pubDate>Thu, 25 Oct 2007 09:48:47 GMT</pubDate>
      <description>&lt;p&gt;
Requêtes ayant consommées le plus de cycle CPU
&lt;/p&gt;
&lt;p&gt;
Les DMV sys.dm_exec_query_stats, en association avec sys.dm_exec_sql_text, permet
de connaître les requêtes ayant consommées le plus de cycle CPU.
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;TOP&lt;/span&gt; 50
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.total_worker_time),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; sys.dm_exec_query_stats
T1 &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CROSS&lt;/span&gt; APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;GROUP&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.plan_handle,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ORDER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.total_worker_time) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;DESC&lt;/span&gt; &lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=5c61d405-bd2b-4fe9-957e-13aee8a76ce0" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,5c61d405-bd2b-4fe9-957e-13aee8a76ce0.aspx</comments>
      <category>SQL-Server 2005</category>
      <category>Tips</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=e46ab4e5-c23e-409c-8796-fb58b7b6d15b</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,e46ab4e5-c23e-409c-8796-fb58b7b6d15b.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,e46ab4e5-c23e-409c-8796-fb58b7b6d15b.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=e46ab4e5-c23e-409c-8796-fb58b7b6d15b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Requêtes ayant souffert de blocages
</p>
        <p>
Les DMV <font color="#008000">sys.dm_exec_query_stats</font>, en association avec <font color="#008000">sys.dm_exec_sql_text</font>,
permet de connaître les requêtes ayant le plus souffert de blocages (le temps d’exécution
est supérieur au temps ‘travaillé’, signifiant que la requête à été victime temporairement
d’un blocage).
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">TOP</span> 50    
        <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.total_elapsed_time
- T1.total_worker_time),     T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span> sys.dm_exec_query_stats
T1 <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">CROSS</span> APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2     <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">GROUP</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>         T1.plan_handle,
        T2.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">text</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ORDER</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>         <span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SUM</span>(T1.total_elapsed_time
- T1.total_worker_time ) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DESC</span></span>
        </pre>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=e46ab4e5-c23e-409c-8796-fb58b7b6d15b" />
      </body>
      <title>SQL Tips #4</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,e46ab4e5-c23e-409c-8796-fb58b7b6d15b.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/10/25/SQLTips4.aspx</link>
      <pubDate>Thu, 25 Oct 2007 09:47:21 GMT</pubDate>
      <description>&lt;p&gt;
Requêtes ayant souffert de blocages
&lt;/p&gt;
&lt;p&gt;
Les DMV &lt;font color=#008000&gt;sys.dm_exec_query_stats&lt;/font&gt;, en association avec &lt;font color=#008000&gt;sys.dm_exec_sql_text&lt;/font&gt;,
permet de connaître les requêtes ayant le plus souffert de blocages (le temps d’exécution
est supérieur au temps ‘travaillé’, signifiant que la requête à été victime temporairement
d’un blocage).
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;TOP&lt;/span&gt; 50&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.total_elapsed_time
- T1.total_worker_time), &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; sys.dm_exec_query_stats
T1 &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;CROSS&lt;/span&gt; APPLY
sys.dm_exec_sql_text(T1.plan_handle) T2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;GROUP&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.plan_handle,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;text&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ORDER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SUM&lt;/span&gt;(T1.total_elapsed_time
- T1.total_worker_time ) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;DESC&lt;/span&gt; &lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=e46ab4e5-c23e-409c-8796-fb58b7b6d15b" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,e46ab4e5-c23e-409c-8796-fb58b7b6d15b.aspx</comments>
      <category>SQL-Server 2005</category>
      <category>Tips</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=d5ef58fe-e0c9-4f12-9368-b8b7f04273ce</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,d5ef58fe-e0c9-4f12-9368-b8b7f04273ce.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,d5ef58fe-e0c9-4f12-9368-b8b7f04273ce.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=d5ef58fe-e0c9-4f12-9368-b8b7f04273ce</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Les DMV dm_db_missing_index_* permettent de déterminer les indexes manquants. Ces
informations sont basées sur l’analyse de l’exécution des requêtes depuis le démarrage
de SQL-Server 2005.
</p>
        <p>
Quatre DMV permettent d’obtenir des informations, d’un point de vue générale 
jusqu’au détail (détail de colonnes à indexer).
</p>
        <p>
La hiérarchie est la suivante :<br /><font color="#008000">dm_db_missing_index_group_stats</font>          Information
générale<br />
-&gt; <font color="#008000">dm_db_missing_index_groups</font>             Information
sur un groupe d’indexes<br />
     -&gt; <font color="#008000">dm_db_missing_index_details</font>        Information
sur un index<br />
          -&gt; <font color="#008000">dm_db_missing_index_columns</font> Information
des colonnes d’un index
</p>
        <p>
Le calcul de la priorité (l’importance) de création d’un index est basé sur trois
paramètres :<br />
1. Le coût<br />
2. l’impacte<br />
3. le nombre de lecture
</p>
        <p>
En effet, créer un index sur une table n’ayant qu’un index primaire aura un grand
impact sur la performance. Par contre, si cette table n’est accédée qu’un fois pas
année, la création de cet index ne devrait pas être un priorité. Mieux vaut alors
insérer un index sur une table accédée de miliers de fois par minutes, même si l’impacte
par requête est faible. 
</p>
        <p>
La requête suivante indique les indexes manquant a créer, par ordre de priorité (selon
le calcule ci-dessus) :
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>     T1.avg_total_user_cost
* T1.avg_user_impact * (T1.user_seeks + T1.user_scans) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'Priorite'</span>,
        T3.* <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span>     sys.dm_db_missing_index_group_stats
T1 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INNER</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">JOIN</span> sys.dm_db_missing_index_groups
T2     <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ON</span> T2.index_group_handle
= T1.group_handle <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INNER</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">JOIN</span> sys.dm_db_missing_index_details
T3         <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ON</span> T3.index_handle
= T2.index_handle <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span>         T3.database_id
= 8 – A remplacer par l’ID de la base désirée <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ORDER</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>     avg_total_user_cost
* avg_user_impact * (user_seeks + user_scans) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DESC</span>; </span>
        </pre>
        <p>
Note : 
<br />
Le résultat des DMV est le reflet de la base lors de l’execution des DMV. Lors de
la création d’indexes basé sur ces vues, prendre soins de sauvegarder les informations.
En effet, suite à la création d’un index, les DMV vont réévaluer les informations.
</p>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=d5ef58fe-e0c9-4f12-9368-b8b7f04273ce" />
      </body>
      <title>SQL Tips #3</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,d5ef58fe-e0c9-4f12-9368-b8b7f04273ce.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/10/24/SQLTips3.aspx</link>
      <pubDate>Wed, 24 Oct 2007 13:36:44 GMT</pubDate>
      <description>&lt;p&gt;
Les DMV dm_db_missing_index_* permettent de déterminer les indexes manquants. Ces
informations sont basées sur l’analyse de l’exécution des requêtes depuis le démarrage
de SQL-Server 2005.
&lt;/p&gt;
&lt;p&gt;
Quatre DMV permettent d’obtenir des informations, d’un point de vue générale&amp;nbsp;
jusqu’au détail (détail de colonnes à indexer).
&lt;/p&gt;
&lt;p&gt;
La hiérarchie est la suivante :&lt;br&gt;
&lt;font color=#008000&gt;dm_db_missing_index_group_stats&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Information
générale&lt;br&gt;
-&amp;gt; &lt;font color=#008000&gt;dm_db_missing_index_groups&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Information
sur un groupe d’indexes&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; &lt;font color=#008000&gt;dm_db_missing_index_details&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Information
sur un index&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;gt; &lt;font color=#008000&gt;dm_db_missing_index_columns&lt;/font&gt;&amp;nbsp;Information
des colonnes d’un index
&lt;/p&gt;
&lt;p&gt;
Le calcul de la priorité (l’importance) de création d’un index est basé sur trois
paramètres :&lt;br&gt;
1.&amp;nbsp;Le coût&lt;br&gt;
2.&amp;nbsp;l’impacte&lt;br&gt;
3.&amp;nbsp;le nombre de lecture
&lt;/p&gt;
&lt;p&gt;
En effet, créer un index sur une table n’ayant qu’un index primaire aura un grand
impact sur la performance. Par contre, si cette table n’est accédée qu’un fois pas
année, la création de cet index ne devrait pas être un priorité. Mieux vaut alors
insérer un index sur une table accédée de miliers de fois par minutes, même si l’impacte
par requête est faible. 
&lt;/p&gt;
&lt;p&gt;
La requête suivante indique les indexes manquant a créer, par ordre de priorité (selon
le calcule ci-dessus) :
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.avg_total_user_cost
* T1.avg_user_impact * (T1.user_seeks + T1.user_scans) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'Priorite'&lt;/span&gt;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T3.* &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.dm_db_missing_index_group_stats
T1 &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;INNER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;JOIN&lt;/span&gt; sys.dm_db_missing_index_groups
T2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ON&lt;/span&gt; T2.index_group_handle
= T1.group_handle &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;INNER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;JOIN&lt;/span&gt; sys.dm_db_missing_index_details
T3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ON&lt;/span&gt; T3.index_handle
= T2.index_handle &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;WHERE&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T3.database_id
= 8 – A remplacer par l’ID de la base désirée &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ORDER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;avg_total_user_cost
* avg_user_impact * (user_seeks + user_scans) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;DESC&lt;/span&gt;; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Note : 
&lt;br&gt;
Le résultat des DMV est le reflet de la base lors de l’execution des DMV. Lors de
la création d’indexes basé sur ces vues, prendre soins de sauvegarder les informations.
En effet, suite à la création d’un index, les DMV vont réévaluer les informations.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=d5ef58fe-e0c9-4f12-9368-b8b7f04273ce" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,d5ef58fe-e0c9-4f12-9368-b8b7f04273ce.aspx</comments>
      <category>SQL-Server 2005</category>
      <category>Tips</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=af7bd533-aa52-45a6-8cf1-3b0af6033199</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,af7bd533-aa52-45a6-8cf1-3b0af6033199.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,af7bd533-aa52-45a6-8cf1-3b0af6033199.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=af7bd533-aa52-45a6-8cf1-3b0af6033199</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Un index est fragmenté lorsque l’ordre logique des informations stockées dans les
pages (basée sur les clés de l’index) ne correspondent plus à l’ordre physique des
informations stockées dans les fichiers de données.<br /><br />
SQL-Server 2005 offre deux possibilités :<br />
- La réorganisation de l’index<br />
   S’applique lorsque le taux de fragmentation de l’index se situe entre
5% et 30%.<br />
- La reconstruction de l’index<br />
   S’applique lorsque le taux de fragmentation de l’index est supérieur
à  30%.<br /><br />
La DMV sys.dm_db_index_physical_stats nous renseigne sur le taux de fragmentation.
La requête suivante liste tous les indexes d’un serveur (pour lister uniquement une
base, changer le premier paramètre de la DMV), dont le taux de fragmentation est supérieur
à 5%.
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>     T3.Name <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> Table_Name,
    T2.Name <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> Index_Name,
    T1.avg_fragmentation_in_percent <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span>     sys.dm_db_index_physical_stats(<span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>,<span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>,<span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>,<span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>,<span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">null</span>) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span> T1 <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INNER</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">JOIN</span> sys.indexes
T2     <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ON</span> T1.<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">OBJECT_ID</span> =
T2.<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">OBJECT_ID</span>     <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AND</span> T1.INDEX_ID
= T2.INDEX_ID <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">INNER</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">JOIN</span> sys.tables
T3     <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ON</span> T3.<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">OBJECT_ID</span> =
T2.<span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">OBJECT_ID</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span>     T1.avg_fragmentation_in_percent
&gt; 5     <span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AND</span> T2.Name <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">IS</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">NOT</span><span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">NULL</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">ORDER</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">BY</span>     T1.avg_fragmentation_in_percent <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">DESC</span></span>
        </pre>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=af7bd533-aa52-45a6-8cf1-3b0af6033199" />
      </body>
      <title>SQL Tips #2</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,af7bd533-aa52-45a6-8cf1-3b0af6033199.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/10/24/SQLTips2.aspx</link>
      <pubDate>Wed, 24 Oct 2007 12:22:08 GMT</pubDate>
      <description>&lt;p&gt;
Un index est fragmenté lorsque l’ordre logique des informations stockées dans les
pages (basée sur les clés de l’index) ne correspondent plus à l’ordre physique des
informations stockées dans les fichiers de données.&lt;br&gt;
&lt;br&gt;
SQL-Server 2005 offre deux possibilités :&lt;br&gt;
- La réorganisation de l’index&lt;br&gt;
&amp;nbsp;&amp;nbsp; S’applique lorsque le taux de fragmentation de l’index se situe entre
5% et 30%.&lt;br&gt;
- La reconstruction de l’index&lt;br&gt;
&amp;nbsp;&amp;nbsp; S’applique lorsque le taux de fragmentation de l’index est supérieur
à&amp;nbsp; 30%.&lt;br&gt;
&lt;br&gt;
La DMV sys.dm_db_index_physical_stats nous renseigne sur le taux de fragmentation.
La requête suivante liste tous les indexes d’un serveur (pour lister uniquement une
base, changer le premier paramètre de la DMV), dont le taux de fragmentation est supérieur
à 5%.
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T3.Name &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; Table_Name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T2.Name &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; Index_Name,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.avg_fragmentation_in_percent &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.dm_db_index_physical_stats(&lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;,&lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;null&lt;/span&gt;) &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; T1 &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;INNER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;JOIN&lt;/span&gt; sys.indexes
T2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ON&lt;/span&gt; T1.&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;OBJECT_ID&lt;/span&gt; =
T2.&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;OBJECT_ID&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AND&lt;/span&gt; T1.INDEX_ID
= T2.INDEX_ID &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;INNER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;JOIN&lt;/span&gt; sys.tables
T3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ON&lt;/span&gt; T3.&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;OBJECT_ID&lt;/span&gt; =
T2.&lt;span style="FONT-SIZE: 11px; COLOR: fuchsia; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;OBJECT_ID&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;WHERE&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.avg_fragmentation_in_percent
&amp;gt; 5 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AND&lt;/span&gt; T2.Name &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;IS&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;NOT&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: silver; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;NULL&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;ORDER&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;BY&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;T1.avg_fragmentation_in_percent &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;DESC&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=af7bd533-aa52-45a6-8cf1-3b0af6033199" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,af7bd533-aa52-45a6-8cf1-3b0af6033199.aspx</comments>
      <category>SQL-Server 2005</category>
      <category>Tips</category>
    </item>
    <item>
      <trackback:ping>http://www.vsdotnet.ch/Trackback.aspx?guid=342abc0f-3b82-4bad-b9e0-0acf29eb3dc4</trackback:ping>
      <pingback:server>http://www.vsdotnet.ch/pingback.aspx</pingback:server>
      <pingback:target>http://www.vsdotnet.ch/PermaLink,guid,342abc0f-3b82-4bad-b9e0-0acf29eb3dc4.aspx</pingback:target>
      <dc:creator>Stéphane Schwartz</dc:creator>
      <wfw:comment>http://www.vsdotnet.ch/CommentView,guid,342abc0f-3b82-4bad-b9e0-0acf29eb3dc4.aspx</wfw:comment>
      <wfw:commentRss>http://www.vsdotnet.ch/SyndicationService.asmx/GetEntryCommentsRss?guid=342abc0f-3b82-4bad-b9e0-0acf29eb3dc4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Un index devient inutiles lorsque le nombre de mise à jour de l’index (update) est
supérieur au nombre fois que cet index est utilisé pour une lecture (seeks, scans
&amp; lookup). Le moteur passe donc plus de temps à le maintenir à jour qu’il n’est
réellement utilisé … C’est comme maintenir un annuaire téléphonique à jour alors que
les abonnées utilisent d’autre moyen (carnet d’adresse local, …) pour se contacter.
</p>
        <p>
La DMV sys.dm_db_index_usage_stats nous donne ces informations :
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">SELECT</span>     user_updates <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'#ECRITURE'</span>,
    user_seeks + user_scans + user_lookups <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">AS</span><span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">'#LECTURE'</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">FROM</span>         sys.dm_db_index_usage_stats <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">WHERE</span>         user_updates
&gt; (user_seeks + user_scans + user_lookups) </span>
        </pre>
        <img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=342abc0f-3b82-4bad-b9e0-0acf29eb3dc4" />
      </body>
      <title>SQL Tips #1</title>
      <guid isPermaLink="false">http://www.vsdotnet.ch/PermaLink,guid,342abc0f-3b82-4bad-b9e0-0acf29eb3dc4.aspx</guid>
      <link>http://www.vsdotnet.ch/2007/10/24/SQLTips1.aspx</link>
      <pubDate>Wed, 24 Oct 2007 12:05:25 GMT</pubDate>
      <description>&lt;p&gt;
Un index devient inutiles lorsque le nombre de mise à jour de l’index (update) est
supérieur au nombre fois que cet index est utilisé pour une lecture (seeks, scans
&amp;amp; lookup). Le moteur passe donc plus de temps à le maintenir à jour qu’il n’est
réellement utilisé … C’est comme maintenir un annuaire téléphonique à jour alors que
les abonnées utilisent d’autre moyen (carnet d’adresse local, …) pour se contacter.
&lt;/p&gt;
&lt;p&gt;
La DMV sys.dm_db_index_usage_stats nous donne ces informations :
&lt;/p&gt;
&lt;pre&gt;&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;SELECT&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;user_updates &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'#ECRITURE'&lt;/span&gt;,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;user_seeks + user_scans + user_lookups &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;AS&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;'#LECTURE'&lt;/span&gt; &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;FROM&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sys.dm_db_index_usage_stats &lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;WHERE&lt;/span&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;user_updates
&amp;gt; (user_seeks + user_scans + user_lookups) &lt;/span&gt;&lt;/pre&gt;&lt;img width="0" height="0" src="http://www.vsdotnet.ch/aggbug.ashx?id=342abc0f-3b82-4bad-b9e0-0acf29eb3dc4" /&gt;</description>
      <comments>http://www.vsdotnet.ch/CommentView,guid,342abc0f-3b82-4bad-b9e0-0acf29eb3dc4.aspx</comments>
      <category>Tips</category>
      <category>SQL-Server 2005</category>
    </item>
  </channel>
</rss>