Home  >  Article  >  Database  >  【SQL】关于存储过程调用过程中事务的点点滴滴

【SQL】关于存储过程调用过程中事务的点点滴滴

WBOY
WBOYOriginal
2016-06-07 17:42:271185browse

1、调用两个存储过程 -- -------------------------------------------------------------- -- 表[dbo].[aaa_test]中[id]为主键 -- . , @p_name varchar ( 50 ) . ( , ) VALUES ( @p_id , @p_name ) . , @p_name varchar ( 50 ) . ( , ) VALUES ( @p_id , @p

 

1、调用两个存储过程

---------------------------------------------------------------- -- 表[dbo].[aaa_test]中[id]为主键 --., @p_name varchar(50) . ( ,) VALUES (@p_id ,@p_name) ., @p_name varchar(50) . ( ,) VALUES (@p_id ,@p_name) dbo.aaa_test_proc1 ,dbo.aaa_test_proc2 , --(1 行受影响) --消息 2627,级别 14,状态 1,香港服务器租用,过程 aaa_test_proc2,美国空间,第 11 行 --违反了 PRIMARY KEY 约束 'PK_aaa_test'。不能在对象 'dbo.aaa_test' 中插入重复键。 --

id name

1 事务测试1







-- 【结论】:不明确指定事务时,美国服务器,两次存储过程调用是分开的两个事务
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn