Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL Server 2008ÐÂÌØÐÔ£­Êý¾ÝѹËõ

Êý¾ÝѹËõ£¨Data Compression£©ÊÇSQL Server 2008ÒýÈëµÄÐÂÌØÐÔÖ®Ò»£¬ÕâÏî¼¼ÊõʹÊý¾Ý¸üÓÐЧµÄ±£´æ²¢ÇÒ¼«´ó¼õÉÙÁË´æ´¢¿ªÏú£¬Í¬Ê±Ò²´øÀ´ÁËÐÔÄÜÉϵÄÏÔÖøÌá¸ß£¬ÓÈÆäÊǶÔÐèÒª´óÁ¿´ÅÅÌI/OµÄÊý¾Ý²Ö¿â¡£
 
×¢£ºÆäʵÔÚSQL Server 2005 SP2°æ±¾ÖУ¬ÒѾ­ÒýÈëÁË vardecimal £¬ËüʹÓñ䳤µÄ¸ñʽ´æ´¢¶¨³¤µÄdecimalºÍnumbericÊý¾Ý¡£
 
SQL Server 2008Ö§³ÖÁ½ÖÖÊý¾ÝѹËõ£ºÐÐѹËõ£¨Row Compression£©ºÍÒ³ÃæÑ¹Ëõ£¨Page Compression£©¡£
Êý¾ÝѹËõ½öÔÚÆóÒµ°æºÍ¿ª·¢°æÖпÉÓá£
 
ÐÐѹËõ½«¶¨³¤µÄ×Ö¶ÎÒԱ䳤µÄÎïÀí¿Õ¼äÀ´´æ´¢£¬´Ó¶ø½ÚÊ¡ÁË´æ´¢¿Õ¼ä¡£
ÀýÈ磬¶¨³¤µÄ×Ö¶Îchar£¨100£©Öд洢“SQL Server 2008”Ö»ÐèÒª15×Ö·ûµÄ³¤¶È£¬¶ø·Ç100×Ö·û£¬´Ó¶ø½ÚÔ¼ÁË85%µÄ¿Õ¼ä£¬ÁíÍ⣬¶ÔÓÚ0ºÍnull£¬½«²»Õ¼Óô洢¿Õ¼ä¡£
ÐÐѹËõϸ÷ÀàÐÍÊý¾ÝµÄ¿Õ¼äÕ¼Óãº
Êý¾ÝÀàÐÍ
ÊÇ·ñÓ°Ïì
ϸ½Ú
tinyint
No
1 byte is the minimum storage needed.
smallint
Yes
If the value fits in 1 byte, only 1 byte will be used.
int
Yes
Uses only the bytes that are needed. For example, if a value can be stored in 1 byte, storage will take only 1 byte.
bigint
Yes
Uses only the bytes that are needed. For example, if a value can be stored in 1 byte, storage will take only 1 byte.
decimal
Yes
This storage is exactly same as the vardecimal storage format. For more information, see Storing Decimal Data As Variable Length.
numeric
Yes
This storage is exactly same as the vardecimal storage format. For more information, see Storing Decimal Data As Variable Length.
bit
Yes
The metadata overhead brings this to 4 bits.
smallmoney
Yes
Uses the integer data representation by using a 4-byte integer. Currency value is multiplied by 10000 and the resulting integer value is stored by removing any digits after the decimal point. This type has a storage optimization similar to that for integer types.
money
Yes
Uses the integer data representation by using an 8-byte integer. Currency value is multiplied by 10000 and the resulting integer value is stored by removing any digits after the decimal point. This type has a larger range than smallmoney. This type


Ïà¹ØÎĵµ£º

ORACLE ³£ÓõÄSQLÓï·¨ºÍÊý¾Ý¶ÔÏó

 Ò».Êý¾Ý¿ØÖÆÓï¾ä (DML) ²¿·Ö
            1.Insert (ÍùÊý¾Ý±íÀï²åÈë¼Ç¼µÄÓï¾ä)
            Insert INTO ±íÃû(×Ö¶ÎÃû1, ×Ö¶ÎÃû2, ……) VALUES ( Öµ1, Öµ2, ……);
&nb ......

ORACLEºÍSQLÓï·¨Çø±ð¹éÄÉ

ORACLEºÍSQLÓï·¨Çø±ð¹éÄÉ
Êý¾ÝÀàÐͱȽÏ
ÀàÐÍÃû³Æ
Oracle
SQLServer
±È½Ï
×Ö·ûÊý¾ÝÀàÐÍ CHAR CHAR ¶¼Êǹ̶¨³¤¶È×Ö·û×ÊÁϵ«oracleÀïÃæ×î´ó¶ÈΪ2kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
±ä³¤×Ö·ûÊý¾ÝÀàÐÍ VARCHAR2 VARCHAR OracleÀïÃæ×î´ó³¤¶ÈΪ4kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¹Ì¶¨³¤¶È×Ö·û´® NCHAR NCHA ......

ÔÚmysqlÖÐÖ´ÐÐsqlÎļþ£¨Èçtest.sql£©µÄ³£Ó÷½·¨

ÔÚmysqlÖÐÖ´ÐÐsqlÎļþ£¨Èçtest.sql£©µÄ³£Ó÷½·¨
    ÎªÁË·½±ã£¬¿ÉÒÔ½«mysqlµÄ°²×°Â·¾¶ÏÂbinĿ¼µÄµØÖ··Åµ½»·¾³±äÁ¿PATHÖУ¬Èç;C:\Program Files\MySQL\MySQL Server 5.0\bin¡£ÕâÑùÔÚÈÎÒâλÖôò¿ªµÄÃüÁîÐгÌÐò¶¼ÄÜÕÒµ½mysql.exe¡£
    ¿ÉÒÔ´ò¿ªmysqlÃüÁîÐУ¬Ò²¿ÉÒÔÔÚÃüÁîÐÐÖÐͨ¹ýmysql -u r ......

SQL °æ±¾²éѯ¼°¶ÔÓ¦¹ØÏµ

Òª»ñµÃÕýÔÚÔËÐеÄSQL Server 2005µÄ°æ±¾ºÅ£¬¿Éͨ¹ýSQL Server Management StudioÁ¬½Óµ½¸Ã·þÎñÆ÷£¬È»ºóÔËÐÐÒÔÏÂSQLÓï¾ä£º
SELECT  SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
Ðк󣬿ɵõ½ÐèÒªµÄ°æ±¾ÐÅÏ¢£¬ÀýÈçÔÚÎҵĻúÆ÷ÉÏÔËÐкóµÃµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ