得到自增列的下一个会插入的id
时间:2024-01-20 17:32:48
declare @Table_name varchar(60)
set @Table_name = 'Pay_inputpay';
Select so.name Table_name, --表名字
sc.name Iden_Column_name, --自增字段名字
ident_current(so.name) curr_value, --自增字段当前值
ident_incr(so.name) incr_value, --自增字段增长值
ident_seed(so.name) seed_value --自增字段种子值
from sysobjects so
Inner Join syscolumns sc
on so.id = sc.id
and columnproperty(sc.id, sc.name, 'IsIdentity') = 1
Where upper(so.name) = upper(@Table_name)
--@Table_name是传入参数 表名 curr_value这个就是准备插入的id
标签:自增长,id
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python反反爬虫技术限制连续请求时间处理
2023-08-27 13:53:04
![](https://img.aspxhome.com/file/2023/2/62542_0s.jpg)
CSS+asp仿迅雷人气指数
2009-08-03 14:11:00
![](https://img.aspxhome.com/file/UploadPic/20098/3/520098210240-50s.jpg)
Python中一些不为人知的基础技巧总结
2023-07-19 21:59:42
MySql5.5忘记root密码怎么办
2024-01-23 01:02:45
![](https://img.aspxhome.com/file/2023/5/69865_0s.jpg)
python实现自动化群控的步骤
2023-07-04 11:50:25
![](https://img.aspxhome.com/file/2023/1/105701_0s.png)
Python实现格式化输出的实例详解
2023-03-15 10:01:59
![](https://img.aspxhome.com/file/2023/4/92194_0s.jpg)
Python聚类算法之DBSACN实例分析
2021-03-26 00:11:10
![](https://img.aspxhome.com/file/2023/7/120607_0s.png)
Python类的多重继承问题深入分析
2023-08-13 14:41:17
php逐行读取txt文件写入数组的方法 <font color=red>原创</font>
2023-11-14 17:22:07
Python程序实现向MySQL存放图片
2022-12-02 13:34:38
![](https://img.aspxhome.com/file/2023/0/67840_0s.png)
python web基础之加载静态文件实例
2023-04-22 10:09:49
Python+Tkinter绘制一个数字时钟
2021-08-06 05:24:05
![](https://img.aspxhome.com/file/2023/6/114616_0s.gif)
php使用ZipArchive函数实现文件的压缩与解压缩
2023-07-12 20:58:19
如何创建并使用一个断开连接的记录集的数据访问页?
2009-11-14 20:50:00
python 中的列表生成式、生成器表达式、模块导入
2021-06-11 06:29:10
仿淘宝星级评分效果
2010-09-03 18:37:00
python的reverse函数翻转结果为None的问题
2022-06-20 16:27:32
关于Python中的同步异步阻塞与非阻塞
2021-09-03 05:54:01
canvas实现手机端用来上传用户头像的代码
2023-09-16 02:30:54
Python可视化Matplotlib介绍和简单图形的绘制
2021-09-01 21:16:44
![](https://img.aspxhome.com/file/2023/8/109508_0s.jpg)