惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security Affairs
N
News and Events Feed by Topic
T
Tenable Blog
P
Proofpoint News Feed
W
WeLiveSecurity
Simon Willison's Weblog
Simon Willison's Weblog
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
Help Net Security
Help Net Security
I
Intezer
T
Threat Research - Cisco Blogs
S
Secure Thoughts
C
Cyber Attacks, Cyber Crime and Cyber Security
L
Lohrmann on Cybersecurity
AWS News Blog
AWS News Blog
Google Online Security Blog
Google Online Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Know Your Adversary
Know Your Adversary
Project Zero
Project Zero
The Hacker News
The Hacker News
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Tor Project blog
N
News | PayPal Newsroom
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
A
Arctic Wolf
Forbes - Security
Forbes - Security
O
OpenAI News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Security Latest
Security Latest
P
Palo Alto Networks Blog
S
Schneier on Security
S
Securelist
C
Cybersecurity and Infrastructure Security Agency CISA
H
Heimdal Security Blog
V
Vulnerabilities – Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园_首页
T
Troy Hunt's Blog
Latest news
Latest news
Recent Announcements
Recent Announcements
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
L
LINUX DO - 热门话题
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium
V
Visual Studio Blog
H
Hacker News: Front Page

博客园 - 空空儿

硬盘分区、寻址和系统启动过程 JavaScript里String.Format方法的实现 asp.net异步页 利用Spire.DataExport将数据(Database/DataTable)导成各种文件 使用XML的value()方法将多行数据合并成一列 获取所有的外键信息 ASP.NET application and page life cycle SQL Server 2005 CLR 调用Web Service需要注意的几个问题 SQL SERVRE 2005 CLR TVF错误:从用户定义的表值函数获取新行时出错:Data access is not allowed in this context. PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now 在C#里使用属性 - 空空儿 - 博客园 Read text file (txt, csv, log, tab, fixed length) 批量写数据---将XML数据批量写入数据库 对对象类型和调用方法属性进行存储以提升反射性能 过程 sp_addlinkedsrvlogin,第 91 行解密过程中出错的解决办法 生成大量随机字符串不同实现方式的效率对比 用SQL SERVER 2005新提供的命令实现行列转换 APM (异步编程模型) 利用宏让ERStudio生成代码文件
获取SQL Server数据行的物理地址信息(%%lockress%% & %%physloc%%)
空空儿 · 2011-03-19 · via 博客园 - 空空儿

在SQL Server 2005里可以通过%%lockress%%得到数据行对应的物理路径信息,在SQL Server2008里还可以通过%%physloc%% 得到,用sys.fn_PhysLocFormatter 将得到的binary数据转换后就是%%lockress%% 的值,但是,这几个在MSDN里都没有介绍.

%%lockress%% 得到值包含了3部分:文件编号,页编号和位置编号,并以冒号分隔.

select *,%%lockres%% as phys from dbTest

得到的结果是:

id          name       phys
----------- ---------- --------------------------------
1           A          1:77:0
2           B          1:77:1
3           C          1:77:2

在SQL Server2008里执行

select *,%%physloc%% as phys from dbTest

得到的结果是:

id          name       phys
----------- ---------- ------------------
1           A          0x7300000001000000
2           B          0x7300000001000100
3           C          0x7300000001000200

在SQL Server2008里执行

 select *,sys.fn_PhysLocFormatter(%%physloc%%)  as physfrom dbTest 

得到的结果是:

id          name       phys
----------- ---------- ----------------------------
1           A          (1:115:0)
2           B          (1:115:1)
3           C          (1:115:2)

因为SQL Sever2005和SQL Server2008在不同的机器上,所以得到的物理信息是不一样的,得到的这个信息,相当于是一张表的一个隐藏的唯一键列,所以通过这个可以很方便的处理一些问题,比如删除没有主键表里的重复数据,但是MSDN里没有相关的说明,所以使用时要考虑一些风险.