SQL SERVERµÄÉó¼Æ¹¦ÄÜ
ÆôÓÃc2ÉóºËÃüÁîÈçÏ£º
EXEC sp_configure 'c2 audit mode', '1' RECONFIGURE
SQL ServerÒÔ128KB´óСµÄ¿éΪµ¥Î»°ÑÊý¾ÝдÈë¸ú×ÙÎļþ¡£Òò´Ë£¬µ±SQL Server·ÇÕý³£Í£Ö¹Ê±£¬×î¶à¿ÉÄܶªÊ§128
KBµÄÈÕÖ¾Êý¾Ý¡£¿ÉÒÔÏëÏ󣬰üº¬ÉóºËÐÅÏ¢µÄÈÕÖ¾Îļþ½«ÒԺܿìµÄËÙ¶ÈÔö´ó¡£ÀýÈ磬ij´ÎÊÔÑéÖ»·ÃÎÊÁËÈý¸ö±í£¬¸ú×ÙÎļþÒѾ³¬¹ýÁË1MB¡£µ±¸ú×ÙÎļþ³¬¹ý
200MBʱ£¬C2ÉóºË½«¹Ø±Õ¾ÉÎļþ²¢´´½¨ÐÂÎļþ¡£Ã¿´ÎSQL ServerÆô¶¯µÄʱºò£¬Ëü»á´´½¨Ò»¸öеĸú×ÙÎļþ¡£Èç¹û´ÅÅ̿ռ䲻×㣬SQL
Server½«Í£Ö¹ÔËÐУ¬Ö±ÖÁÎÒÃÇΪÉóºËÈÕÖ¾Êͷųö×ã¹»µÄ´ÅÅ̿ռ䲢ÖØÐÂÆô¶¯SQL ServerʵÀý¡£ÔÚSQL
ServerÆô¶¯µÄʱºò£¬¿ÉÒÔʹÓÃ-f²ÎÊý½ûÓÃÉóºË¡£
Ïà¹ØÎĵµ£º
Another Look at MySQL 5.1's SQL Diagnostic Tools
http://dev.mysql.com/tech-resources/articles/mysql_51_diagnostic_tools.html Êý¾Ý¿âµÄÐÔÄܾö¶¨ÒòËØ£º
£¨1£©Êý¾Ý¿âµÄÉè¼Æ
£¨2£©SQL´úÂë ¿ÉÒÔÓÃÒÔϼ¸ÖÖ·½·¨À´½â¾öһЩÐÔÄÜÎÊÌ⣺
£¨1£©Ë÷Òý
£¨2£©Ë®Æ½·ÖÇø
£¨3£©ÁÐÊÊÓ¦µÄ±í
colum ......
char¡¢varchar¡¢textºÍnchar¡¢nvarchar¡¢ntext
charºÍvarcharµÄ³¤¶È¶¼ÔÚ1µ½8000Ö®¼ä£¬ËüÃǵÄÇø±ðÔÚÓÚcharÊǶ¨³¤×Ö·ûÊý¾Ý£¬¶øvarcharÊDZ䳤×Ö·ûÊý¾Ý¡£Ëùν¶¨³¤¾ÍÊdz¤¶È¹Ì¶¨
µÄ£¬µ±ÊäÈëµÄÊý¾Ý³¤¶ÈûÓдﵽָ¶¨µÄ³¤¶Èʱ½«×Ô¶¯ÒÔÓ¢ÎÄ¿Õ¸ñÔÚÆäºóÃæÌî³ä£¬Ê¹³¤¶È´ïµ½ÏàÓ¦µÄ³¤¶È£»¶ø±ä ......
¾ßÓй̶¨ÓÐЧλÊýºÍСÊýλÊýµÄÊýÖµ×ÊÁÏÀàÐÍ¡£
decimal[ (p[ , s] )] and numeric[ (p[ , s] )]
¹Ì¶¨ÓÐЧλÊýºÍСÊýλÊýµÄÊý×Ö¡£µ±Ê¹ÓÃ×î´óÓÐЧλÊýʱ£¬ÓÐЧֵÊÇ´Ó - 10^38 +1 µ½ 10^38 - 1¡£decimal µÄ SQL-92 ͬÒå×ÖÊÇ dec ºÍ dec(p, s)¡£numeric µÄ¹¦ÄÜÏàµ±ì¶ decimal¡£
p (ÓÐЧλÊý)
¿É´¢´æµÄ×î´óÊ®½øλÊý×ÜÊý£¬Ð¡ ......
ÔÚ½éÉÜGROUP BY ºÍ HAVING ×Ó¾äÇ°£¬ÎÒÃDZØÐèÏȽ²½²sqlÓïÑÔÖÐÒ»ÖÖÌØÊâµÄº¯Êý£º¾ÛºÏº¯Êý£¬ÀýÈçSUM, COUNT, MAX, AVGµÈ¡£ÕâЩº¯ÊýºÍÆäËüº¯ÊýµÄ¸ù±¾Çø±ð¾ÍÊÇËüÃÇÒ»°ã×÷ÓÃÔÚ¶àÌõ¼Ç¼ÉÏ¡£
SELECT SUM(population) from bbc
¡¡¡¡ÕâÀïµÄSUM×÷ÓÃÔÚËùÓзµ»Ø¼Ç¼µÄpopulation×Ö¶ÎÉÏ£¬½á¹û¾ÍÊǸòéѯֻ·µ»ØÒ»¸ö½á¹û£¬¼´ËùÓйú¼ÒµÄ× ......
ÏÐÀ´Ð´ÏÂwith cubeµÄÓ÷¨
cubeÔËËã·ûÔÚ SELECT Óï¾äµÄ GROUP BY ×Ó¾äÖÐÖ¸¶¨¡£¸ÃÓï¾äµÄÑ¡ÔñÁбíÓ¦°üº¬Î¬¶ÈÁк;ۺϺ¯Êý±í´ïʽ¡£GROUP BY Ó¦Ö¸¶¨Î¬¶ÈÁк͹ؼü×Ö WITH CUBE¡£½á¹û¼¯½«°üº¬Î¬¶ÈÁÐÖи÷ÖµµÄËùÓпÉÄÜ×éºÏ£¬ÒÔ¼°ÓëÕâЩά¶ÈÖµ×éºÏÏàÆ¥ÅäµÄ»ù´¡ÐÐÖеľۺÏÖµ¡£
ÏÈ¿´ÏÂ±í£º
ÎÒÃÇÒÔid¾ÛºÏ²éѯ³öƽ¾ù·Ö
ÕâÒ»ÌõSQLÓï¾äÓ ......