Rumah >pangkalan data >tutorial mysql >剖析SQLSERVER2005的页面结构--行类型篇一
--------------------------------------------------------------------- -- Author : HappyFlyStone -- Date : 2009-11-30 -- Version: Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86) -- Apr 14 2006 01:12:25 -- Copyright (c) 1988-2005 Micros
---------------------------------------------------------------------
-- Author : HappyFlyStone
-- Date : 2009-11-30
-- Version: Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)
-- Apr 14 2006 01:12:25
-- Copyright (c) 1988-2005 Microsoft Corporation
-- Enterprise Edition on Windows NT 5.2 (Build 3790: SP2)
--
---------------------------------------------------------------------
CREATE PROC sp_us_FPSinfo
@FORWARDING_STUB BINARY(8)
AS
SELECT
CAST(
CONVERT(INT,SUBSTRING(@FORWARDING_STUB,6,1)) * POWER(2,8)
+ CONVERT(INT,SUBSTRING(@FORWARDING_STUB,5,1))
AS VARCHAR)+' : ' --File_num
+CAST(
(CONVERT(INT,SUBSTRING(@FORWARDING_STUB,4,1)) * POWER(2,24))
+ (CONVERT(INT,SUBSTRING(@FORWARDING_STUB,3,1)) * POWER(2,16))
+ (CONVERT(INT,SUBSTRING(@FORWARDING_STUB,2,1)) * POWER(2,8 ))
+ (CONVERT(INT,SUBSTRING(@FORWARDING_STUB,1,1))) AS VARCHAR)
+' : ' --Page_id
+CAST(CAST(SUBSTRING(@FORWARDING_STUB,8,1) * POWER(2,8 ) +
+ SUBSTRING(@FORWARDING_STUB,7,1) AS INT ) AS VARCHAR)
AS 'FILE_NUM:PAGE_ID:SLOT_ID'
GO
EXEC sp_us_FPSinfo 0xDD00000001000200 --
DROP PROC sp_us_FPSinfo
/*
FILE_NUM:PAGE_ID:SLOT
--------------------------
1 : 221 : 2
(1 行受影响)
*/