概述
In sql server there is a something like
IDENTITY_INSERT is set to OFF and we can set in ON after
I wanna know is that something similar in mysql where i need to temporary set off and set ON i.e like
create procedure ()
begin
IDENTITY_INSERT is set to OFF
Some insert statement
Some insert statement
IDENTITY_INSERT is set to ON
end
解决方案
I can't imagine any good reason why you need to switch that off.
If you need to insert any record with your custom id AUTO_INCREMENT is not a barrier.
CREATE TABLE t1 (id int NOT NULL AUTO_INCREMENT, PRIMARY KEY (id));
INSERT INTO t1 VALUES (23);
INSERT INTO t1 VALUES (null);
So why do you need to switch it off?
最后
以上就是阔达大象为你收集整理的mysql 禁止存储过程,MySQL在存储过程中禁用auto_increment列临时的全部内容,希望文章能够帮你解决mysql 禁止存储过程,MySQL在存储过程中禁用auto_increment列临时所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复