{"action":"closed","issue":{"url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/13051","repository_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs","labels_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/13051/labels{/name}","comments_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/13051/comments","events_url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/issues/13051/events","html_url":"https://github.com/MicrosoftDocs/azure-docs/issues/13051","id":348554387,"node_id":"MDU6SXNzdWUzNDg1NTQzODc=","number":13051,"title":"Is this an accurate database size?","user":{"login":"yamatoya","id":2118539,"node_id":"MDQ6VXNlcjIxMTg1Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/2118539?v=4","gravatar_id":"","url":"https://api.github.com/users/yamatoya","html_url":"https://github.com/yamatoya","followers_url":"https://api.github.com/users/yamatoya/followers","following_url":"https://api.github.com/users/yamatoya/following{/other_user}","gists_url":"https://api.github.com/users/yamatoya/gists{/gist_id}","starred_url":"https://api.github.com/users/yamatoya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yamatoya/subscriptions","organizations_url":"https://api.github.com/users/yamatoya/orgs","repos_url":"https://api.github.com/users/yamatoya/repos","events_url":"https://api.github.com/users/yamatoya/events{/privacy}","received_events_url":"https://api.github.com/users/yamatoya/received_events","type":"User","site_admin":false},"labels":[{"id":836704823,"node_id":"MDU6TGFiZWw4MzY3MDQ4MjM=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/assigned-to-author","name":"assigned-to-author","color":"e01f8f","default":false},{"id":854513169,"node_id":"MDU6TGFiZWw4NTQ1MTMxNjk=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/doc-response","name":"doc-response","color":"0684dd","default":false},{"id":646553781,"node_id":"MDU6TGFiZWw2NDY1NTM3ODE=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/sql-database/svc","name":"sql-database/svc","color":"90ccff","default":false},{"id":836702742,"node_id":"MDU6TGFiZWw4MzY3MDI3NDI=","url":"https://api.github.com/repos/MicrosoftDocs/azure-docs/labels/triaged","name":"triaged","color":"0e8a16","default":false}],"state":"closed","locked":false,"assignee":{"login":"CarlRabeler","id":12616095,"node_id":"MDQ6VXNlcjEyNjE2MDk1","avatar_url":"https://avatars1.githubusercontent.com/u/12616095?v=4","gravatar_id":"","url":"https://api.github.com/users/CarlRabeler","html_url":"https://github.com/CarlRabeler","followers_url":"https://api.github.com/users/CarlRabeler/followers","following_url":"https://api.github.com/users/CarlRabeler/following{/other_user}","gists_url":"https://api.github.com/users/CarlRabeler/gists{/gist_id}","starred_url":"https://api.github.com/users/CarlRabeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarlRabeler/subscriptions","organizations_url":"https://api.github.com/users/CarlRabeler/orgs","repos_url":"https://api.github.com/users/CarlRabeler/repos","events_url":"https://api.github.com/users/CarlRabeler/events{/privacy}","received_events_url":"https://api.github.com/users/CarlRabeler/received_events","type":"User","site_admin":false},"assignees":[{"login":"CarlRabeler","id":12616095,"node_id":"MDQ6VXNlcjEyNjE2MDk1","avatar_url":"https://avatars1.githubusercontent.com/u/12616095?v=4","gravatar_id":"","url":"https://api.github.com/users/CarlRabeler","html_url":"https://github.com/CarlRabeler","followers_url":"https://api.github.com/users/CarlRabeler/followers","following_url":"https://api.github.com/users/CarlRabeler/following{/other_user}","gists_url":"https://api.github.com/users/CarlRabeler/gists{/gist_id}","starred_url":"https://api.github.com/users/CarlRabeler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CarlRabeler/subscriptions","organizations_url":"https://api.github.com/users/CarlRabeler/orgs","repos_url":"https://api.github.com/users/CarlRabeler/repos","events_url":"https://api.github.com/users/CarlRabeler/events{/privacy}","received_events_url":"https://api.github.com/users/CarlRabeler/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-08-08T02:41:57Z","updated_at":"2018-08-09T03:47:00Z","closed_at":"2018-08-09T03:46:59Z","author_association":"CONTRIBUTOR","body":"I read a [blog - SQLCAT: Determining Database Size in Azure SQL Database V12](https://blogs.msdn.microsoft.com/sqlcat/2016/09/21/determining-database-size-in-azure-sql-database-v12/) and [Manage file space in Azure SQL Database](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-file-space-management).\r\n\r\nI suggest to change the DMV of Calculating database size.\r\n\r\n```\r\nSELECT SUM(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint) * 8192.) AS DatabaseSizeInBytes,\r\n       SUM(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint) * 8192.) / 1024 / 1024 AS DatabaseSizeInMB,\r\n       SUM(CAST(FILEPROPERTY(name, 'SpaceUsed') AS bigint) * 8192.) / 1024 / 1024 / 1024 AS DatabaseSizeInGB\r\nFROM sys.database_files\r\nWHERE type_desc = 'ROWS';\r\n```\r\n\r\n---\r\n#### Document Details\r\n\r\n⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*\r\n\r\n* ID: 9d159ae2-da25-63a1-2f90-124c158ffd7e\r\n* Version Independent ID: 6226c3b2-0a5b-c762-540b-f1c9eaea1b41\r\n* Content: [Monitoring Azure SQL Database Using Dynamic Management Views](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-monitoring-with-dmvs#calculating-database-size)\r\n* Content Source: [articles/sql-database/sql-database-monitoring-with-dmvs.md](https://github.com/Microsoft/azure-docs/blob/master/articles/sql-database/sql-database-monitoring-with-dmvs.md)\r\n* Service: **sql-database**\r\n* GitHub Login: @CarlRabeler\r\n* Microsoft Alias: **carlrab**"}}
{"actor":{"display_login":"yamatoya"}}