SqlServer获得下一个自增长主键值
sql server中主键字段如果设置成自增,则插入新记录时新记录的ID值可以通过如下语句获得
select ident_current('tablename')+1 --获得自增值
select ident_incr ('table or view') -- 获得步长
select ident_seed( 'table or view') -- 获得种子
select ident_current('tablename')+1 --获得自增值
select ident_incr ('table or view') -- 获得步长
select ident_seed( 'table or view') -- 获得种子
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
分析DB2数据库的锁等待
jeff2007
2020-07-08 09:06:10
Oracle常用当年、当月、当日的查询语句
xiaochenXIHUA
2020-07-07 21:55:12
MSSQL Split表字段
--拆分字符串之後匹配結果集合 CREATE FUNCTION [dbo].[fnSplit]( @sInputList VARCHAR
hxp42
2020-07-07 21:50:58
使用Navicat Premium 11.0.17远程连接Oracle 11.2.0.1.0 64位数据库
xiaochenXIHUA
2020-07-07 21:09:25
Sqlserver高版本数据库还原到低版本方法,SQL2014数据库还原到SQL2012中
xiaochenXIHUA
2020-07-07 21:09:16
sql server 增加 读取binary字段
flyer222
2020-07-07 19:57:11
Ubuntu下彻底解决mysql中文乱码
angelof7
2020-07-06 02:41:32
分布式事务——CAP和Base理论
lishengping_max
2020-07-05 15:51:31
Mysql——事务ACID简介和原理
lishengping_max
2020-07-05 15:07:56
分布式一致性协议——2PC和3PC
lishengping_max
2020-07-05 15:07:56
根据sqlite3.def生成sqlite3.lib
chinacodec
2020-07-05 13:03:01
使用mybatis按时间范围查询数据与数据库查询不一致(时区问题)
With_Her
2020-07-05 06:10:30
DataBase 修改表名/字段名称
飘落的秋风
2020-07-05 01:34:52