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
相关文档:
一.文本导入数据库
--步骤1.创建控制文件
load data --1、控制文件标识
infile 'E:\oradata\orcl\test\inf_user.txt' --2、要输入的数据文件名为inf_user.txt (文件缺省放到C:\ 下,如果不是,就需要指明全路径)
append into table inf_user --3、向表test中� ......
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;
......
Copy 以下内容到查询分析器操作:
-- 3 ****************************************************
-- 熟悉系统自带的一些函数
-- 3.1 --------------------------------------------------
-- 数学函数
-- ABS(num_expression) 返回给定数值表达式的绝对值
-- C ......
同时启动其他sql 服务会出现 错误1068:依存服务或组无法启动(这是由于几个相关联的服务中有一个不能启动)。
错误1069是一个Windows NT/2000的系统错误。错误1069表明服务不能被启动(当启动服务时返回“登录失败”错误)。例如,当启动MSSQLServer服务时,得到如下错误提示:
发生错误1069:由于登录失� ......