{"id":5754,"date":"2019-01-09T17:41:28","date_gmt":"2019-01-09T08:41:28","guid":{"rendered":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/?p=5754"},"modified":"2019-01-11T09:44:16","modified_gmt":"2019-01-11T00:44:16","slug":"sql-server%e3%81%a7%e5%a4%a7%e9%87%8f%e3%83%ac%e3%82%b3%e3%83%bc%e3%83%89%e3%81%ae%e4%bb%b6%e6%95%b0%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/archives\/5754","title":{"rendered":"SQL Server\u3067\u5927\u91cf\u30ec\u30b3\u30fc\u30c9\u306e\u4ef6\u6570\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<div class=\"veu_autoEyeCatchBox\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"500\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-1024x683.jpg\" class=\"attachment-large size-large wp-post-image\" alt=\"\" srcset=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-1024x683.jpg 1024w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-300x200.jpg 300w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-768x512.jpg 768w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076.jpg 1280w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/div>\n<h2>\u8981\u70b9<\/h2>\n<p>\u30b7\u30b9\u30c6\u30e0\u30fb\u30b9\u30c8\u30a2\u30c9\u30fb\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u300csp_spaceused\u300d\u3092\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<p>EXEC sp_spaceused [\u30c6\u30fc\u30d6\u30eb\u540d];<\/p>\n<p>&nbsp;<\/p>\n<h2>\u8a73\u7d30\uff08\u5931\u6557\u306e\u7d4c\u7def\uff09<\/h2>\n<p>\u88fd\u9020\u696dIoT\u62c5\u5f53\u306e\u682b\u3067\u3059\u3002<\/p>\n<p>IoT\u306e\u53d6\u308a\u639b\u304b\u308a\u3067\u3001\u81ea\u793e\u8cc7\u6e90\u3092\u9593\u501f\u308a\u3057\u3066\u30c7\u30fc\u30bf\u53ce\u96c6\u3059\u308b\u3068\u3057\u3066\u3001\u30bb\u30f3\u30b5\u30fc\u30c7\u30fc\u30bf\u3092RDB\u306b\u767b\u9332\u3059\u308b\u3068\u3001\u601d\u3044\u306e\u307b\u304b\u3001\u30ec\u30b3\u30fc\u30c9\u304c\u304b\u3055\u307f\u307e\u3059\u3002<\/p>\n<p>\uff08\u304b\u3055\u307f\u307e\u3057\u305f\u3002\u3002\u3002\uff09<\/p>\n<p>\u30b7\u30b9\u30c6\u30e0\u691c\u8a3c\u74b0\u5883\u306b\u3001SQL Server\u3092\u5229\u7528\u3057\u305f\u3068\u304d\u3001\u5927\u91cf\u30c7\u30fc\u30bf\u4ef6\u6570\uff0821\u5104\u4ef6\u8d8a\u3048\uff09\u3092\u78ba\u8a8d\u3057\u305f\u3068\u304d\u306e\u5099\u5fd8\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u3068\u3042\u308b\u30c6\u30fc\u30d6\u30eb\u306e\u4ef6\u6570\u306e\u78ba\u8a8d\u306b\u3001\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u3001\u30c7\u30fc\u30bf\u4ef6\u6570\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>SELECT A.name AS \u30c6\u30fc\u30d6\u30eb\u540d, B.rows AS \u7dcf\u4ef6\u6570<br \/>\nFROM sys.objects AS A<br \/>\nJOIN sys.sysindexes AS B<br \/>\nON A.object_id = B.id AND B.indid &lt; 2<br \/>\nWHERE A.type = &#8216;U&#8217;<br \/>\nORDER BY A.name<\/p>\n<p>\u78ba\u8a8d\u306e\u305f\u3081\u3001\u30c6\u30fc\u30d6\u30eb\u3092\u53c2\u7167\u3057\u3066\u30ab\u30a6\u30f3\u30c8\u3057\u3066\u307f\u305f\u3089\u3001\u3001\u3001\u3001<\/p>\n<p>SELECT count(1) FROM [\u8abf\u3079\u305f\u3044\u30c6\u30fc\u30d6\u30eb]<\/p>\n<p>\u3067\u3001\u30aa\u30fc\u30d0\u30fc\u30d5\u30ed\u30fc\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\uff08\u30bb\u30f3\u30b5\u30fc\u30c7\u30fc\u30bf\u306e\u84c4\u7a4d\u306fRDB\u306f\u5411\u304b\u306a\u3044\u306a\u3068\u3044\u3046\u53cd\u7701\u306f\u5225\u306b\u3057\u3066\u3002\u3002\u3002\uff09<\/p>\n<p>&nbsp;<\/p>\n<p>\u3002\u3002\u3002\u3002\u3068\u3059\u308b\u3068\u3001\u300ccount(1)\u300d\u304cint\u306e\u6700\u5927\u5024\u3092\u8d85\u3048\u305f\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001<\/p>\n<p>\u672c\u5f53\u306f\u30012^31-1 (2,147,483,647)\u225221\u5104\u4ef6\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u306a\u306e\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u4ef6\u6570\u306f\u3001\u5b9f\u614b\u304b\u3089\u304b\u3044\u96e2\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0b\u306e\u3088\u3046\u306b\u300ccount(1)\u300d\u3092CAST\u3059\u308c\u3070\u3001\u53d6\u5f97\u3067\u304d\u306a\u304f\u306f\u306a\u3044\u3067\u3059\u304c\u300115\u5206\u9593\u5f85\u3063\u3066\u3082\u7d50\u679c\u304c\u8fd4\u3063\u3066\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>select CAST(count(1) AS BIGINT) from [\u8abf\u3079\u305f\u3044\u30c6\u30fc\u30d6\u30eb]<\/p>\n<p>&nbsp;<\/p>\n<p>\u305d\u3053\u3067\u3001\u30b7\u30b9\u30c6\u30e0\u30fb\u30b9\u30c8\u30a2\u30c9\u30fb\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u300csp_spaceused\u300d\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u53d6\u5f97\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>EXEC sp_spaceused [\u30c6\u30fc\u30d6\u30eb\u540d];<\/p>\n<p>&nbsp;<\/p>\n<p>\u4ee5\u4e0a\u3001\u5099\u5fd8\u9332\u3067\u3057\u305f\uff01<\/p>\n<p>\u30ea\u30bd\u30fc\u30b9\u3084\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u3001\u3042\u308a\u3082\u306e\u3092\u99c6\u4f7f\u3057\u3066\u3001\u697d\u3005IoT\u30e9\u30a4\u30d5\u3092\u9001\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u4eca\u5e74\u3082\u3001\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-5756\" src=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-1024x683.jpg\" alt=\"\" width=\"750\" height=\"500\" srcset=\"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-1024x683.jpg 1024w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-300x200.jpg 300w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076-768x512.jpg 768w, https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-content\/uploads\/2019\/01\/pic_c076.jpg 1280w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8981\u70b9 \u30b7\u30b9\u30c6\u30e0\u30fb\u30b9\u30c8\u30a2\u30c9\u30fb\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u300csp_spaceused\u300d\u3092\u5229\u7528\u3057\u307e\u3059\u3002 EXEC sp_spaceused [\u30c6\u30fc\u30d6\u30eb\u540d]; &nbsp; \u8a73\u7d30\uff08\u5931\u6557\u306e\u7d4c\u7def\uff09 \u88fd\u9020\u696dIoT\u62c5\u5f53\u306e\u682b\u3067\u3059\u3002 IoT\u306e\u53d6\u308a\u639b\u304b\u308a\u3067\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5756,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"vkexunit_cta_each_option":"","footnotes":""},"categories":[657],"tags":[658],"class_list":["post-5754","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-657","tag-sql-server"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/5754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/comments?post=5754"}],"version-history":[{"count":4,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/5754\/revisions"}],"predecessor-version":[{"id":5788,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/posts\/5754\/revisions\/5788"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/media\/5756"}],"wp:attachment":[{"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/media?parent=5754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/categories?post=5754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ois-yokohama.co.jp\/oisblog2018\/wp-json\/wp\/v2\/tags?post=5754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}