MYSQL:
我正在使用表 information_schema.tables 中的 AUTO_INCRMENT 列来获取下一个 id。
如下:
SELECT AUTO_INCREMENT FROM information_schema.tables WHERE table_name = 'TableName' AND table_schema = 'DBNAME' ;
SQL 服务器:
sql server 中表 information_schema.tables 中的 MYSQL AUTO_INCRMENT 列等效于什么?
我想在 sql server 2012 中实现相同的功能。
谢谢
最佳答案
我找到了系统函数IDENT_CURRENT这和我想要的一样。
select IDENT_CURRENT('tablename')+1 as AUTO_INCREMENT;
希望它对其他人也有帮助。
谢谢
关于mysql - 相当于 sql server 中表 information_schema.tables 中的 MYSQL AUTO_INCREMENT 列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27202137/