易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL SERVER 2005 页面文件头部结构

       Next up in the Inside the Storage Engine series is a discussion of page structure. Pages exist to store records. A database page is an 8192-byte (8KB) chunk of a database data file. They are aligned on 8KB boundaries within the data files, starting at byte-offset 0 in the file.
Here's a picture of the basic structure
Header
The page header is 96 bytes long. What I'd like to do in this section is take an example page header dump from DBCC PAGE and explain what all the fields mean. I'm using the database from the page split post and I've snipped off the rest of the DBCC PAGE output.
DBCC
TRACEON (3604)DBCC
PAGE ('pagesplittest', 1, 143, 1);GO
m_pageId = (1:143)                   m_headerVersion = 1                  m_type = 1
m_typeFlagBits = 0x4                 m_level = 0                          m_flagBits = 0x200
m_objId (AllocUnitId.idObj) = 68     m_indexId (AllocUnitId.idInd) = 256 
Metadata: AllocUnitId = 72057594042384384                                
Metadata: PartitionId = 72057594038386688                                 Metadata: IndexId = 1
Metadata: ObjectId = 2073058421      m_prevPage = (0:0)           &


相关文档:

SQL Server和Oracle常用函数对比


数学函数
1.绝对值
S:select abs(-1) value
O:select abs(-1) value from dual
2.取整(大)
S:select ceiling(-1.001) value
O:select ceil(-1.001) value from dual
3.取整(小)
S:select floor(-1.001) value
O:select floor(-1.001) value from dual
4.取整(截取)
S:select cast(-1.002 as in ......

简单的sql登录和注册存储过程

 首先我建好了一张用户表表中有俩个字段 一个是账号,一个是密码当然这里我写的知识简单的登录很注册,
表明 users 用户表
字段 accountnum  varchar(50) --表示账号
        password     varchar(50) --表示密码
登录存储过程
create proc use_l ......

SQL CASE 语句

 Case具有两种格式。简单Case函数和Case搜索函数。
--简单Case函数
CASE sex
         WHEN '1' THEN '男'
         WHEN '2' THEN '女'
ELSE '其他' END
--Case搜索函数
CASE WHEN sex = '1' THEN '男'
    ......

尽量不要拼凑Sql语句,用参数来防注入

    如果是类似"select   *   from   user   where   uid="+uid +"  and   pwd="+pwd 很容易出问题
    使用   SQLParamenter      
    把你的SQL语句写成   类似存储过程   ......

一个SQL面试题

 题目要求
阿里baba的面试题
有三个表
    学生表  S 
          SID  SNAME
  教师课表 T 
          TID  TNAME  TCL
  成绩表  SC &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号