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
Ïà¹ØÎĵµ£º
»ñÈ¡¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ýsqlserver×Ö¶ÎÃèÊö
Select o.name AS tableName, c.name AS columnName, p.[value] AS Description
from sysproperties p INNER JOIN
sysobjects o ON o.id = p.id INNER JOIN
syscolumn ......
ORACLEºÍSQLÓï·¨Çø±ð¹éÄÉ
Êý¾ÝÀàÐͱȽÏ
ÀàÐÍÃû³Æ
Oracle
SQLServer
±È½Ï
×Ö·ûÊý¾ÝÀàÐÍ CHAR CHAR ¶¼Êǹ̶¨³¤¶È×Ö·û×ÊÁϵ«oracleÀïÃæ×î´ó¶ÈΪ2kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
±ä³¤×Ö·ûÊý¾ÝÀàÐÍ VARCHAR2 VARCHAR OracleÀïÃæ×î´ó³¤¶ÈΪ4kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¹Ì¶¨³¤¶È×Ö·û´® NCHAR NCHA ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using AHUT_TetWebERP;
......
Êý¾Ý¿âÀàÐÍΪDateTimeÀàÐÍ£¬½«Æä×öÄ£ºý²éѯʱ£¬ÔÚHibernateÖУ¬¿ÉÒÔÓÃÆ´SQLµÄÎÊÌ⽫Æä½â¾ö£¬¼´ÔÚSQL²éѯ·ÖÎöÆ÷дSQLÒ»Ñù£¬µ«ÊÇÀûÓòÎÊýÅäÖã¬Ôò·½·¨ÈçÏ£º
1¡¢Æ´ÉÏSQL,È磺
String beginPara= &q ......
ͬʱÆô¶¯ÆäËûsql ·þÎñ»á³öÏÖ ´íÎó1068:ÒÀ´æ·þÎñ»ò×éÎÞ·¨Æô¶¯£¨ÕâÊÇÓÉÓÚ¼¸¸öÏà¹ØÁªµÄ·þÎñÖÐÓÐÒ»¸ö²»ÄÜÆô¶¯£©¡£
´íÎó1069ÊÇÒ»¸öWindows NT/2000µÄϵͳ´íÎó¡£´íÎó1069±íÃ÷·þÎñ²»Äܱ»Æô¶¯£¨µ±Æô¶¯·þÎñʱ·µ»Ø“µÇ¼ʧ°Ü”´íÎ󣩡£ÀýÈ磬µ±Æô¶¯MSSQLServer·þÎñʱ£¬µÃµ½ÈçÏ´íÎóÌáʾ£º
·¢Éú´íÎó1069£ºÓÉÓڵǼʧ° ......