当前位置 > 首页 > Sql

SQL事务处理中出错了,执行到“EXEC xp_cmdshell 'bcp ...”请高手指点,谢谢!代码如下

2012-10-19 15:18:00来源:Sql

BEGIN TRAN my_tran
save TRAN my_sav
update a
set HSS01='RMV HSUB:SUBID="+86519'+ Number +'@js.ctcims.cn";'
update a
set HSS='RMV HSDAINF:IMPI="+86519'+ Number +'@js.ctcims.cn";'
update a
set ENS01='RMV DNAPTRREC:E164NUM="'+ Number +'",ZONENAME="9.1.5.6.8.e164.arpa";'
update a
set AGCF53='RMV ASBR: PUI="sip:+86519'+ Number +'@js.ctcims.cn";'
insert into b (ZL) VALUES ('USE ME:Name=NJ_HSS01;')
insert into b (ZL) select HSS01 from a
insert into b (ZL) select HSS from a
insert into b (ZL) VALUES ('USE ME:Name=NJ_HSS02;')
insert into b (ZL) select HSS01 from a
insert into b (ZL) select HSS from a
insert into b (ZL) VALUES ('USE ME:Name=NJ_ENS02;')
insert into b (ZL) select ENS01 from a
insert into b (ZL) VALUES ('USE ME:Name=NJ_ENS01;')
insert into b (ZL) select ENS01 from a
insert into b (ZL) VALUES ('USE ME:Name=NJ_AGCF53;')
insert into b (ZL) select AGCF53 from a
insert into b (ZL) VALUES ('USE ME:Name=NJ_AGCF54;')
insert into b (ZL) select AGCF53 from a
EXEC xp_cmdshell 'bcp "SELECT ZL FROM a..b" queryout D:\指令.txt -T -c -t,'
ROLLBACK TRAN my_sav