{"id":1373,"date":"2003-10-30T18:15:25","date_gmt":"2003-10-30T18:15:25","guid":{"rendered":"http:\/\/bluesoul.pe.kr\/wp\/?p=1373"},"modified":"2003-10-30T18:15:25","modified_gmt":"2003-10-30T18:15:25","slug":"mssql%ed%8a%b9%ec%a0%95-%eb%94%94%eb%b9%84%ec%9d%98-%eb%aa%a8%eb%93%a0-%ed%85%8c%ec%9d%b4%eb%b8%94%ec%97%90-row%ec%88%98-%ec%b9%b4%ec%9a%b4%ed%8a%b8%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/bluesoul.pe.kr\/wp\/?p=1373","title":{"rendered":"[mssql]\ud2b9\uc815 \ub514\ube44\uc758 \ubaa8\ub4e0 \ud14c\uc774\ube14\uc5d0 row\uc218 \uce74\uc6b4\ud2b8\ud558\uae30"},"content":{"rendered":"<p> select  count(*)  from  \ud14c\uc774\ube14\uba85<br \/>\n\uc694  sql\ubb38\uc744  \ud14c\uc774\ube14\uc218  \ub9cc\ud07c  \ub3cc\ub9b4\uc218\ub3c4  \uc788\ub2e4.<br \/>\n\ubb3c\ub860  \ud55c  50\uac1c\ub9cc  \ub118\uc5b4\uac00\ub3c4  \uc911\uac04\uc5d0  \ud3ec\uae30\ud560\ud14c\uc9c0\ub9cc..<br \/>\n\uc694\ub7f4\ub54c  \uc694\uae34\ud558\uac8c  \uc4f8\uc218  \uc788\ub294  \ud504\ub85c\uc2dc\uc800\ub97c  \ub9cc\ub4e4\uc790.<br \/>\n\uc694\uac78  \uc774\uc6a9\ud574\uc11c  \ub2e4\uc591\ud558\uac8c  \uc751\uc6a9\ud560\uc218  \uc788\uc744\uac83\uc774\ub2e4.<br \/>\n\ud2b9\uc815\ub0a0\uc9dc\uc758  \ud2b9\uc815  \ud14c\uc774\ube14\uc5d0  \ub300\ud55c  \uce74\uc6b4\ud2b8  \uc218\ub4f1\ub4f1..<\/p>\n<p>create  proc  pGetRowCount  as<br \/>\nset  nocount  on  &#8212;  \uacb0\uacfc  \uba54\uc2dc\uc9c0\ub97c  \ubfcc\ub9ac\uc9c0  \uc54a\ub294\ub2e4.<br \/>\ndeclare  curGetTableName  INSENSITIVE  CURSOR  &#8212;  \uc778\ud150\uc2dc\ube0c  \ucee4\uc11c\ub97c  \uc120\uc5b8  \ud15c\ud504\ub514\ube44\ub97c  \ub9cc\ub4e4\uc5b4\uc11c  \ube60\ub984<br \/>\nfor<br \/>\n    select  table_name  from  information_schema.tables<br \/>\n    where  table_type  =  &#8216;base  table&#8217;<br \/>\nfor  read  only  &#8212;  \uc77d\uae30\uc804\uc6a9\uc73c\ub85c<\/p>\n<p>open  curGetTableName  &#8212;  declare\uc5d0\uc11c  \uc815\uc758\ud55c  \ucee4\uc11c\ub97c  \uc5f0\ub2e4.<\/p>\n<p>declare  @tblName  varchar(30),  @sql  varchar(100)<\/p>\n<p>fetch  from  curGetTableName  into  @tblName  &#8212;  \ucee4\uc11c\uc5d0\uc11c  \ud589\uc744  \uc5bb\uc5b4  \ubcc0\uc218\uc5d0  \ub123\ub294\ub2e4.<\/p>\n<p>while  @@FETCH_STATUS  =  0  &#8212;  0\uc774\uba74  \uc131\uacf5\uc801\uc73c\ub85c  \uac00\uc838\uc628\uac83<br \/>\nbegin<br \/>\n    select  @sql  =  &#8216;select  count(*)  from  [&#8216;+@tblName+&#8217;]&#8217;<br \/>\n    select  @sql<br \/>\n    exec  (@sql)<br \/>\n    fetch  from  curGetTableName  into  @tblName<br \/>\nend<\/p>\n<p>close  curGetTableName<br \/>\ndeallocate  curGetTableName    &#8212;  \ucee4\uc11c\uac00  \uc0ac\uc6a9\ud558\ub358  \uc790\uc6d0\uc744  \ud480\uc5b4\uc900\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>select count(*) from \ud14c\uc774\ube14\uba85 \uc694 sql\ubb38\uc744 \ud14c\uc774\ube14\uc218 \ub9cc\ud07c \ub3cc\ub9b4\uc218\ub3c4 \uc788\ub2e4. \ubb3c\ub860 \ud55c 50\uac1c\ub9cc \ub118\uc5b4\uac00\ub3c4 \uc911\uac04\uc5d0 \ud3ec\uae30\ud560\ud14c\uc9c0\ub9cc.. \uc694\ub7f4\ub54c \uc694\uae34\ud558\uac8c \uc4f8\uc218 \uc788\ub294 \ud504\ub85c\uc2dc\uc800\ub97c \ub9cc\ub4e4\uc790. \uc694\uac78 \uc774\uc6a9\ud574\uc11c \ub2e4\uc591\ud558\uac8c \uc751\uc6a9\ud560\uc218 \uc788\uc744\uac83\uc774\ub2e4. \ud2b9\uc815\ub0a0\uc9dc\uc758 \ud2b9\uc815 \ud14c\uc774\ube14\uc5d0 \ub300\ud55c \uce74\uc6b4\ud2b8 \uc218\ub4f1\ub4f1.. create proc pGetRowCount as set nocount on &#8212; \uacb0\uacfc \uba54\uc2dc\uc9c0\ub97c \ubfcc\ub9ac\uc9c0 \uc54a\ub294\ub2e4. declare curGetTableName INSENSITIVE CURSOR &#8212; \uc778\ud150\uc2dc\ube0c \ucee4\uc11c\ub97c \uc120\uc5b8 \ud15c\ud504\ub514\ube44\ub97c \ub9cc\ub4e4\uc5b4\uc11c &hellip; <a href=\"https:\/\/bluesoul.pe.kr\/wp\/?p=1373\" class=\"more-link\">\uacc4\uc18d \uc77d\uae30<span class=\"screen-reader-text\"> &#8220;[mssql]\ud2b9\uc815 \ub514\ube44\uc758 \ubaa8\ub4e0 \ud14c\uc774\ube14\uc5d0 row\uc218 \uce74\uc6b4\ud2b8\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1373","post","type-post","status-publish","format-standard","hentry","category-tip"],"_links":{"self":[{"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1373"}],"version-history":[{"count":0,"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1373\/revisions"}],"wp:attachment":[{"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bluesoul.pe.kr\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}