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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - zeus2

Xfire的初次使用 SQl Server 2012正式版发布 单例模式的三种实现方法 Oracle常用Hint Oracle 设计海量数据库 读书笔记(三) Oracle 设计海量数据库 读书笔记(二) Oracle 设计海量数据库 读书笔记(一) 解决中文ID3标签乱码zz 系统架构性能提高方案! 使用开源工具架设开发平台 修改SQL Server数据库地址 System.DateTimeOffset Load的问题 关于__doPostBack之前截获调用 - zeus2 - 博客园 当应用程序发布到iis7/iis7.5出现需要使用经典模式时 - zeus2 - 博客园 XML序列化封装 根据实体类生成查询安全版 生活太艰难了。!!! 从底层角度看ASP.NET-A low-level Look at the ASP.NET Architecture(转载) C++访问Sqlite数据库(存档) - zeus2 - 博客园
[读书笔记]SQL技术内幕Identity
zeus2 · 2009-08-03 · via 博客园 - zeus2
首先创建表

CREATE TABLE customer
(
cust_id      smallint     IDENTITY NOT NULL,
cust_name    varchar(50)  NOT NULL
)

获取当前表种子和自增大小:

SELECT IDENT_SEED('customer'), IDENT_INCR('customer')

下面2个语句等价:

SELECT IDENTITYCOL FROM customer

SELECT cust_id FROM customer

随便插入2条数据:

INSERT customer VALUES ('ACME Widgets')

INSERT customer (cust_name) VALUES ('AAA Gadgets')

获取当前标识列值:

SELECT IDENT_CURRENT('customer')比如 目前就是2
即插入一堆垃圾数据然后删除,会导致Identity不能使用连续值即断开现象,用这个语句可以解决:
DBCC CHECKIDENT