sqlserverÊý¾Ý¿âµÄ´óС - MS-SQL Server / »ù´¡Àà
ͬÑùµÄÊý¾Ýsqlserver¾¹ýÊÕËõ£¬Çå¿ÕÈÕÖ¾ ×îºó´óСÊÇ196M
ÆäÖÐÖ»ÓÐÒ»¸ö±íµÄÊý¾Ý¶àһЩ ´óÔ¼42ÍòÌõÊý¾Ý£¬µ¼³ö³ÉÎı¾ºóÊÐ62M
µ«ÎÒ°ÑÕû¸öÊý¾Ý¿âµ¼³öµ½ASAÊý¾Ý¿âºóÊý¾ÝÎļþÊÇ48M£¬ÈÕÖ¾ÎļþÊÇ40M£¬
Ϊʲô»á²î±ðÕâô´ó£¿
sqlserverµÄÊý¾Ý¿â»¹ÓÐûÓа취ÔÙËõС£¿
²»Í¬Êý¾Ý¿âÖ®¼ä¸ñʽ£¬´æ´¢·½Ê½£¬¿Õ¼ä·ÖÅ䶼²»Ò»Ñù£¬Ã»Ê²Ã´¿É±ÈÐԵġ£
use dbname
go
EXEC sp_spaceused
unallocated space¾ÍÊÇÒѾÄãÊý¾Ý¿âÀïµÄ¿ÉÓÿռ䣨ͨ³£Õⲿ·Ý¾ÍÊÇ¿ÉÒÔÊÕËõµôµÄ£©.
unallocated space ÊÇ-128.42M ÊǸºÊý£¬£¬£¬Õâ¸öÊý¾Ý¿âÊÇÒѾÊÕËõÍêµÄ£¬»¹ÓÐûÓÐÆäËû°ì·¨£¿
use dbname
go
EXEC sp_spaceused null,true
GO
ÔÙ¿´¿´
database size 196M
unallocated 0.11M
²îµã¾Í¾Í²îµã£¬ÊDz»ÊÇÄãµÃASAÀïû½¨Ë÷Òý£¬sqlserverÀィÁËË÷Òý
Ä¿Ç°À´¿´Ã»µÄÊÕËõÁË¡£
ÄãµÄÄÇЩ±í¶¼Óоۼ¯Ë÷ÒýÂ𣿠ÓеĻ°¶¼Öؽ¨£¬Ã»Óоͽ¨Á¢¾Û¼¯Ë÷Òý£¬È»ºóÔÙÊÕËõ£¬ÕâÑùÓ¦¸ÃÄÜÔÚÌÚ³öЩ¿Õ¼äÀ´¡£
Èç¹û±íÉÏÓоۼ¯Ë÷Òý¡£¡£¡£É¾³ýÊý¾Ýºó¿Õ¼äÊDz»»áÊͷųöÀ´µÄ¡£¡£¡£Öؽ¨Ë÷Òýºó²Å»áÊÍ·Å¿Õ¼ä°É¡£
ºÃÏñÊÇÕâÑù¡£¡£¡£
ûÓÐÔٺõİ취ÁËÂð£¿
ÎÒ¿´Ã
Ïà¹ØÎÊ´ð£º
ÎÒÓÐÒ»¸ö±í£¬½á¹¹ÊÇÕâÑù¡£
ת³ö µ¥Î» תÈ뵥λ ±ÊÊý ½ð¶î
date(Ö÷) outid(Ö÷) inid(Ö÷) num amt
2009 1 2 1 500 Ϊ 1 µ¥Î» ÔÚ2009Ä ......
ÈçºÎÔÚSQL2005ÖÐÉ趨¶¨Ê±×÷Òµ£¬±ÈÈç˵¶¨Ê±ÇåÀíijЩ±íµÄÊý¾Ý£¬
»òÕßÊǶ¨Ê±µÄ½«Ä³Ð©±íµÄÊý¾Ýµ¼³öexcel£¡
ÔÚÏߵȴý£¬¼±¼±¼±£¬×îºÃÊÇÏêϸ²½Ö裡
֮ǰÎÒ×öµÄ×÷ÒµÓеãÎÊÌ⣡
°ïUP
²Î¿¼:http://hi.baidu.com/toiota ......
1¡£ÔõÑùʹxp_cmdshellÄÜÍêÕûÊä³ö³¬¹ý255¸ö×Ö·ûµÄ×Ö·û´®¡£
2¡£select ʱ£¬¼ìË÷ËÙ¶ÈÊÇÓëfromºóµÄ TABLE˳ÐòÓйأ¬»¹ÊÇÓëwhereÌõ¼þµÄ˳ÐòÓйØ(TABLEÊý¾Ý¶àÉÙ )
ÔÚϵͳÊôÐÔÉ趨ÀïÓиöÑ¡Ïî,¿ÉÒÔÐ޸ĵ¥×Ö¶ÎÊä³ö×ÖÊýÏÞÖÆ. ......
ÐèÇóÈçÏ£º
ѧԺ academy£¨aid,aname£©
°à¼¶ class£¨cid,cname,aid£©
ѧÉú stu(sid,sname,aid,cid)
סËÞÇø region(rid,rname)
ËÞÉáÂ¥ build(bid,rid,bnote) bnoteÊÇ¡®ÄС¯/¡®Å®¡¯
ËÞÉá dorm(did,rid,bid£¬bedn ......
²éѯѧÉúƽ¾ù³É¼¨¼°ÆäÃû´Î
SELECT 1+(SELECT COUNT( distinct ƽ¾ù³É¼¨)
from (SELECT S#,AVG(score) AS ƽ¾ù³É¼¨
from SC&n ......