Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CorpusHermeticum : DatabaseFileSize.xml en erreur, ne compile pas ! #6

Open
hamidmira opened this issue Jul 20, 2017 · 1 comment
Open
Assignees

Comments

@hamidmira
Copy link

Une petite erreur (une parenthèse en trop) s'est glissée dans la requête SQL du fichier DatabaseFileSize.xml

"Msg 156, Level 15, State 1, Line 11
Incorrect syntax near the keyword 'as'. "

En plus, je te suggère pour l'homogénéité des unités, et pour un plus de clarté dans les noms des colonnes, la requête corrigée puis légèrement modifiée ci-dessous :

<?xml version="1.0" encoding="utf-8" ?>
<hermeticus name="DatabaseFileSize" level="Server" folder="Databases"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Corpus.xsd">
  <header>
    <description lang="fr" tooltip="Espace dans les fichiers des bases de données" label="Fichiers et taille de bases" />
  </header>
  <queries>
    <query versionMajor="*">
      <![CDATA[
SELECT
	DB_NAME(mf.database_id) as [db_name],
	mf.file_id   as [file_id],
	mf.type_desc as [type_desc],
	mf.name as [logical_file_name],
	(CAST(mf.size as bigint) * 8192) / 1024 / 1024 as size_MB,
	CASE mf.max_size
		WHEN 0 THEN 'fixe'
		WHEN -1 THEN 'unlimited'
		WHEN 268435456 THEN '2 TB'
		ELSE CAST(CAST(mf.max_size as bigint) / 128 as varchar(50)) + ' MB'
	END as max_size,
	CASE mf.is_percent_growth
		WHEN 1 THEN CAST(mf.growth as varchar (20)) + '%'
		ELSE CAST((mf.growth * 8192) / 1024 / 1024  as varchar (20)) + ' MB'
	END AS grow
FROM sys.master_files mf
ORDER BY mf.database_id, mf.file_id
OPTION (RECOMPILE);
]]>
    </query>
  </queries>
 </hermeticus>

A+

@rudi-bruchez
Copy link
Owner

c'est noté, je change ça rapidement

@rudi-bruchez rudi-bruchez self-assigned this Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants