{"id":1519,"date":"2010-08-17T09:35:29","date_gmt":"2010-08-17T08:35:29","guid":{"rendered":"http:\/\/blog.capdata.fr\/?p=1519"},"modified":"2022-12-01T17:57:55","modified_gmt":"2022-12-01T16:57:55","slug":"une-alternative-a-xp_fixeddrives","status":"publish","type":"post","link":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/","title":{"rendered":"Une alternative \u00e0 xp_fixeddrives"},"content":{"rendered":"<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1519&#038;text=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1519&#038;title=Une%20alternative%20%C3%A0%20xp_fixeddrives\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Une%20alternative%20%C3%A0%20xp_fixeddrives&#038;body=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20:%20https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1519\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a><p>Pour faire simple, le besoin est de pouvoir r\u00e9cup\u00e9rer l&#8217;\u00e9quivalent d&#8217;un <strong>df <\/strong>(UNIX) en Transact-SQL, c&#8217;est \u00e0 dire \u00e7a:<\/p>\n<pre><span style=\"color: #0000ff;\">$ df -k\r\nSys. de fich.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1K-blocs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Occup\u00e9     Disponible  Capacit\u00e9     Mont\u00e9 sur\r\nc:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 40957684\u00a0    28061160\u00a0   12896524\u00a0   69%         \/cygdrive\/c\r\ne:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 210170360     133011444\u00a0  77158916\u00a0   64%         \/cygdrive\/e\r\ng:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 78153152\u00a0    19149152\u00a0   59004000\u00a0   25%         \/cygdrive\/g\r\nv:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 61440576\u00a0    30980608\u00a0   30459968\u00a0   51%         \/cygdrive\/v<\/span><\/pre>\n<p>Il existe dans SQL Server une proc\u00e9dure stock\u00e9e \u00e9tendue<em> xp_fixeddrives<\/em> qui renvoie une approximation table-valu\u00e9e du df, mais il y manque des informations importantes comme par exemple la taille du drive:<\/p>\n<pre><span style=\"color: #0000ff;\">exec xp_fixeddrives\r\n\r\ndrive   Mo disponibles\r\n-----   --------------\r\nC\t12594\r\nE\t75350\r\nG\t57621\r\nV\t29746<\/span><\/pre>\n<p>Il nous fallait donc r\u00e9\u00e9crire notre propre <em>xp_fixeddrives <\/em>en le formattant comme un <strong>df<\/strong> (sans l&#8217;information du point de montage), sous la forme d&#8217;une fonction table valu\u00e9e en SQLCLR *.<\/p>\n<h3><strong>Le source de <em>fn_fixeddrives.dll<\/em>: <\/strong><strong><br \/>\n<\/strong><\/h3>\n<p>On r\u00e9cup\u00e8re les propri\u00e9t\u00e9s des lecteurs assez simplement en utilisant la m\u00e9thode <em>GetDrives()<\/em> de la classe <em>DriveInfo<\/em>, et on stocke le r\u00e9sultat dans un tableau, que l&#8217;on affiche ensuite ligne \u00e0 ligne.<\/p>\n<pre><span style=\"color: #008000;\">using System;\r\nusing System.Data;\r\nusing System.Data.SqlClient;\r\nusing System.Data.SqlTypes;\r\nusing Microsoft.SqlServer.Server;\r\nusing System.IO;\r\nusing System.Collections;\r\n\r\n<span style=\"color: #0000ff;\">public partial class cFixedDrives\r\n{\r\n    static DriveInfo[] _t_drvlist;\r\n\r\n    [Microsoft.SqlServer.Server.SqlFunction\r\n        (\r\n            FillRowMethodName = \"<span style=\"color: #008000;\">_f_fill<\/span>\",\r\n            TableDefinition = \"<span style=\"color: #008000;\">Drive nvarchar(3), SizeMb bigint, UsedMb bigint, \"<span style=\"color: #0000ff;\">+<\/span>\r\n            \"AvailableMb bigint, UsePct bigint<\/span>\"\r\n        )\r\n    ]\r\n\r\n  <span style=\"color: #008000;\">  \/\/ Main<\/span>\r\n    public static IEnumerable fn_fixeddrives()\r\n    {\r\n        _t_drvlist = DriveInfo.GetDrives();\r\n        ArrayList _t_index = new ArrayList();\r\n        int i = 0;\r\n\r\n        foreach (DriveInfo _drv in _t_drvlist)\r\n        {\r\n            if ((\"<span style=\"color: #008000;\">Fixed<\/span>\" == _drv.DriveType.ToString()) &amp;&amp; (_drv.IsReady))\r\n            {\r\n                _t_index.Add(i);\r\n            }\r\n            i++;\r\n        }\r\n\r\n        return _t_index;\r\n    }\r\n\r\n<span style=\"color: #008000;\">    \/\/ _fill<\/span>\r\n    private static void _f_fill(Object _v_Obj, out string _v_drvName,\r\n                                out long _v_totalsizeMb, out long _v_usedsizeMb,\r\n                                out long _v_freesizeMb, out long _v_pctused)\r\n    {\r\n        int _t_row = (int)_v_Obj;\r\n\r\n        _v_drvName = _t_drvlist[_t_row].Name;\r\n        _v_totalsizeMb = _t_drvlist[_t_row].TotalSize \/ 1048576;\r\n        _v_usedsizeMb = (_t_drvlist[_t_row].TotalSize - _t_drvlist[_t_row].TotalFreeSpace)\r\n                          \/ 1048576;\r\n        _v_freesizeMb = _t_drvlist[_t_row].TotalFreeSpace \/ 1048576;\r\n        _v_pctused = ((_t_drvlist[_t_row].TotalSize - _t_drvlist[_t_row].TotalFreeSpace)\r\n                        * 100 \/ _t_drvlist[_t_row].TotalSize);\r\n    }\r\n};<\/span><\/span><\/pre>\n<p>Globalement, pour qu&#8217;une fonction SQLCLR puisse retourner une table, elle doit renvoyer un type <em>IEnumerable. <\/em>L&#8217;\u00e9l\u00e9ment important est dans le r\u00f4le de la fonction de traitement des lignes (<em> _f_fill()<\/em> ). Cette fonction va \u00eatre appel\u00e9e de mani\u00e8re it\u00e9rative par la fonction principale <em>fn_fixeddrives()<\/em> \u00e0 chaque fois qu&#8217;une ligne du tableau est fetch\u00e9e, un peu comme dans un curseur, et va traiter et retourner la valeur de chaque colonne de la ligne. A la fin de l&#8217;it\u00e9ration, on obtient une table.<\/p>\n<p>La seule vague astuce consiste \u00e0 stocker dans un <em>Arraylist <\/em>les positions dans le <em>DriveInfo[]<\/em> o\u00f9 les lecteurs sont de type &#8216;<em>Fixed<\/em>&#8216;, car les propri\u00e9t\u00e9s de taille ou d&#8217;espace libre ne sont pas renvoy\u00e9es pour les autres types de lecteurs (par exemple les lecteurs de DVD), et plut\u00f4t que de passer \u00e0 <em>_f_fill()<\/em> le tableau <em>DriveInfo[]<\/em> contenant la liste des drives, on passe juste un petit tableau d&#8217;entiers contenant les positions des disques fixes, et on s&#8217;en sert comme d&#8217;un index pour affecter les colonnes en retour. On utilise un <em>ArrayList <\/em>\u00e0 la place d&#8217;un <em>int[] <\/em>parce qu&#8217;on ne sait pas au d\u00e9part combien de lecteurs fixes on aura sur la machine.<\/p>\n<p>A noter le test <span style=\"color: #0000ff;\">&amp;&amp; (_drv.IsReady)<\/span> qui permet d&#8217;\u00e9viter de provoquer une <span style=\"color: #0000ff;\">IOException <\/span>si le drive n&#8217;est pas accessible.<\/p>\n<h3>D\u00e9claration de l&#8217;assembly et de la fonction dans SQL Server:<\/h3>\n<p>La m\u00e9thode <em>GetDrives() <\/em>est consid\u00e9r\u00e9e comme <em>UNSAFE<\/em>, en raison du type d&#8217;appels qu&#8217;elle effectue vers le kernel pour r\u00e9cup\u00e9rer les propri\u00e9t\u00e9s et les tailles des disques. Pour charger l&#8217;assembly dans SQL Server, il faut activer &#8216;<em>clr enabled<\/em>&#8216; et param\u00e9trer la base pour accepter de charger des assemblies UNSAFE:<\/p>\n<pre><span style=\"color: #0000ff;\">sp_configure '<span style=\"color: #008000;\">clr enabled<\/span>',1\r\nGO\r\nreconfigure\r\nGP\r\nalter database clrtest set trustworthy on\r\nGO<\/span><\/pre>\n<p>Enfin, cr\u00e9er l&#8217;assembly et la fonction:<\/p>\n<pre><span style=\"color: #0000ff;\">use clrtest\r\nGO\r\nCREATE ASSEMBLY fixeddrives from '<span style=\"color: #008000;\">E:\\CAPDATA\\DEV\\CLR\\fn_fixeddrives\\bin\\Debug\\fn_fixeddrives.dll<\/span>' WITH PERMISSION_SET = UNSAFE\r\nGO\r\nCREATE FUNCTION fn_fixeddrives ()\r\nRETURNS TABLE (\"<span style=\"color: #008000;\">Drive<\/span>\" nvarchar(3), \"<span style=\"color: #008000;\">Size(Mb)<\/span>\" bigint, \"<span style=\"color: #008000;\">Used(Mb)<\/span>\" bigint, \"<span style=\"color: #008000;\">Available(Mb)<\/span>\" bigint, \"<span style=\"color: #008000;\">Use%<\/span>\" bigint)\r\nAS EXTERNAL NAME fixeddrives.cFixedDrives.fn_fixeddrives\r\nGO<\/span><\/pre>\n<p>Finalement:<\/p>\n<pre><span style=\"color: #0000ff;\">select * from fn_fixeddrives()\r\nGO\r\n<\/span><\/pre>\n<pre><span style=\"color: #0000ff;\">Drive   Size(Mb)  Used(Mb)  Available(Mb)    Use%\r\n----    --------  --------  --------------   -----\r\nC:\\\t39997\t  27403\t    12593\t     68\r\nE:\\\t205244\t  129893    75350\t     63\r\nG:\\\t76321\t  18700\t    57621\t     24\r\nV:\\\t60000\t  30254\t    29746\t     50<\/span><\/pre>\n<p>A+ David B.<\/p>\n<p><strong>* Note<\/strong>: <em>A noter qu&#8217;un <a href=\"https:\/\/www.mssqltips.com\/tip.asp?tip=1986\">pr\u00e9c\u00e9dent <\/a>existe et a \u00e9t\u00e9 publi\u00e9\u00a0 par Andy Novick dans mssqltips.com, mais sa fonction ne filtre pas sur les lecteurs DVD ou CD, et elle est oblig\u00e9e de passer par des pseudo-types SQL (sqlint64) pour tenir compte des colonnes nullable.<br \/>\n<\/em><\/p>\n<div id=\"_mcePaste\" style=\"overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;\">C\u00a0\u00a0 \u00a012594<br \/>\nE\u00a0\u00a0 \u00a075350<br \/>\nG\u00a0\u00a0 \u00a057621<br \/>\nV\u00a0\u00a0 \u00a029746<\/div>\n<p><script src=\"https:\/\/tcr.tynt.com\/javascripts\/Tracer.js?user=d4FlbGI04r35lZadbi-bpO\" type=\"text\/javascript\"><\/script><\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1519&#038;text=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1519&#038;title=Une%20alternative%20%C3%A0%20xp_fixeddrives\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Une%20alternative%20%C3%A0%20xp_fixeddrives&#038;body=Article%20sur%20le%20blog%20de%20la%20Capdata%20Tech%20Team%20%3A%20:%20https%3A%2F%2Fblog.capdata.fr%2Findex.php%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1519\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/blog.capdata.fr\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>Pour faire simple, le besoin est de pouvoir r\u00e9cup\u00e9rer l&#8217;\u00e9quivalent d&#8217;un df (UNIX) en Transact-SQL, c&#8217;est \u00e0 dire \u00e7a: $ df -k Sys. de fich.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1K-blocs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Occup\u00e9 Disponible Capacit\u00e9 Mont\u00e9 sur c:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 40957684\u00a0 28061160\u00a0 12896524\u00a0 69% \/cygdrive\/c e:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 210170360 133011444\u00a0&hellip; <a href=\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\" class=\"more-link\">Continuer la lecture <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":7940,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[158,172,171],"class_list":["post-1519","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sqlserver","tag-c","tag-sqlclr","tag-xp_fixeddrives"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Une alternative \u00e0 xp_fixeddrives - Capdata TECH BLOG<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Une alternative \u00e0 xp_fixeddrives - Capdata TECH BLOG\" \/>\n<meta property=\"og:description\" content=\"Pour faire simple, le besoin est de pouvoir r\u00e9cup\u00e9rer l&#8217;\u00e9quivalent d&#8217;un df (UNIX) en Transact-SQL, c&#8217;est \u00e0 dire \u00e7a: $ df -k Sys. de fich.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1K-blocs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Occup\u00e9 Disponible Capacit\u00e9 Mont\u00e9 sur c:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 40957684\u00a0 28061160\u00a0 12896524\u00a0 69% \/cygdrive\/c e:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 210170360 133011444\u00a0&hellip; Continuer la lecture &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\" \/>\n<meta property=\"og:site_name\" content=\"Capdata TECH BLOG\" \/>\n<meta property=\"article:published_time\" content=\"2010-08-17T08:35:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-01T16:57:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2010\/08\/code.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"500\" \/>\n\t<meta property=\"og:image:height\" content=\"334\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"David Baffaleuf\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Baffaleuf\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\"},\"author\":{\"name\":\"David Baffaleuf\",\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf\"},\"headline\":\"Une alternative \u00e0 xp_fixeddrives\",\"datePublished\":\"2010-08-17T08:35:29+00:00\",\"dateModified\":\"2022-12-01T16:57:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\"},\"wordCount\":490,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/blog.capdata.fr\/#organization\"},\"keywords\":[\"C#\",\"sqlclr\",\"xp_fixeddrives\"],\"articleSection\":[\"SQL Server\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\",\"url\":\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\",\"name\":\"Une alternative \u00e0 xp_fixeddrives - Capdata TECH BLOG\",\"isPartOf\":{\"@id\":\"https:\/\/blog.capdata.fr\/#website\"},\"datePublished\":\"2010-08-17T08:35:29+00:00\",\"dateModified\":\"2022-12-01T16:57:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/blog.capdata.fr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Une alternative \u00e0 xp_fixeddrives\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.capdata.fr\/#website\",\"url\":\"https:\/\/blog.capdata.fr\/\",\"name\":\"Capdata TECH BLOG\",\"description\":\"Le blog technique sur les bases de donn\u00e9es de CAP DATA Consulting\",\"publisher\":{\"@id\":\"https:\/\/blog.capdata.fr\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.capdata.fr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/blog.capdata.fr\/#organization\",\"name\":\"Capdata TECH BLOG\",\"url\":\"https:\/\/blog.capdata.fr\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp\",\"contentUrl\":\"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp\",\"width\":800,\"height\":254,\"caption\":\"Capdata TECH BLOG\"},\"image\":{\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/cap-data-consulting\/mycompany\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf\",\"name\":\"David Baffaleuf\",\"sameAs\":[\"http:\/\/www.capdata.fr\"],\"url\":\"https:\/\/blog.capdata.fr\/index.php\/author\/dbaffaleuf\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Une alternative \u00e0 xp_fixeddrives - Capdata TECH BLOG","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/","og_locale":"fr_FR","og_type":"article","og_title":"Une alternative \u00e0 xp_fixeddrives - Capdata TECH BLOG","og_description":"Pour faire simple, le besoin est de pouvoir r\u00e9cup\u00e9rer l&#8217;\u00e9quivalent d&#8217;un df (UNIX) en Transact-SQL, c&#8217;est \u00e0 dire \u00e7a: $ df -k Sys. de fich.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1K-blocs\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Occup\u00e9 Disponible Capacit\u00e9 Mont\u00e9 sur c:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 40957684\u00a0 28061160\u00a0 12896524\u00a0 69% \/cygdrive\/c e:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 210170360 133011444\u00a0&hellip; Continuer la lecture &rarr;","og_url":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/","og_site_name":"Capdata TECH BLOG","article_published_time":"2010-08-17T08:35:29+00:00","article_modified_time":"2022-12-01T16:57:55+00:00","og_image":[{"width":500,"height":334,"url":"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2010\/08\/code.jpg","type":"image\/jpeg"}],"author":"David Baffaleuf","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"David Baffaleuf","Dur\u00e9e de lecture estim\u00e9e":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#article","isPartOf":{"@id":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/"},"author":{"name":"David Baffaleuf","@id":"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf"},"headline":"Une alternative \u00e0 xp_fixeddrives","datePublished":"2010-08-17T08:35:29+00:00","dateModified":"2022-12-01T16:57:55+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/"},"wordCount":490,"commentCount":1,"publisher":{"@id":"https:\/\/blog.capdata.fr\/#organization"},"keywords":["C#","sqlclr","xp_fixeddrives"],"articleSection":["SQL Server"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/","url":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/","name":"Une alternative \u00e0 xp_fixeddrives - Capdata TECH BLOG","isPartOf":{"@id":"https:\/\/blog.capdata.fr\/#website"},"datePublished":"2010-08-17T08:35:29+00:00","dateModified":"2022-12-01T16:57:55+00:00","breadcrumb":{"@id":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.capdata.fr\/index.php\/une-alternative-a-xp_fixeddrives\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/blog.capdata.fr\/"},{"@type":"ListItem","position":2,"name":"Une alternative \u00e0 xp_fixeddrives"}]},{"@type":"WebSite","@id":"https:\/\/blog.capdata.fr\/#website","url":"https:\/\/blog.capdata.fr\/","name":"Capdata TECH BLOG","description":"Le blog technique sur les bases de donn\u00e9es de CAP DATA Consulting","publisher":{"@id":"https:\/\/blog.capdata.fr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.capdata.fr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/blog.capdata.fr\/#organization","name":"Capdata TECH BLOG","url":"https:\/\/blog.capdata.fr\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/","url":"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp","contentUrl":"https:\/\/blog.capdata.fr\/wp-content\/uploads\/2023\/01\/logo_capdata.webp","width":800,"height":254,"caption":"Capdata TECH BLOG"},"image":{"@id":"https:\/\/blog.capdata.fr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/cap-data-consulting\/mycompany\/"]},{"@type":"Person","@id":"https:\/\/blog.capdata.fr\/#\/schema\/person\/136297da9f61d6e4878abe0f48bc5fbf","name":"David Baffaleuf","sameAs":["http:\/\/www.capdata.fr"],"url":"https:\/\/blog.capdata.fr\/index.php\/author\/dbaffaleuf\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts\/1519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1519"}],"version-history":[{"count":54,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts\/1519\/revisions"}],"predecessor-version":[{"id":9548,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/posts\/1519\/revisions\/9548"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/media\/7940"}],"wp:attachment":[{"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/categories?post=1519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capdata.fr\/index.php\/wp-json\/wp\/v2\/tags?post=1519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}