X
xhaolifu
Unregistered / Unconfirmed
GUEST, unregistred user!
我想将输入sqlserver的数据及时导入oracle库,我采用了触发器,想通过触发程序的方式(xp_cmdshell),
将数据导入oracle。但导入的数据中有memo类型,xp_cmdshell命令带的参数大于255,请问触发器能实现吗?
触发器如下:
CREATE TRIGGER TRIGGER_UP ON BTS_CURRENT_MALFUNTION
FOR insert
AS
declare @finish_T varchar(20)
declare @mal_type varchar(20)
declare @result varchar(200)
declare @note varchar(200)
declare @cmdstr varchar(800)
select @finish_T=reportdate,@mal_type=mal_typeid ,@result=service_result,@note=note from inserted
select @cmdstr='ReturnData.exe 0 '+@finish_t+' '+@mal_type+' '+@result+' '+@note
exec master..xp_cmdshell @cmdstr
将数据导入oracle。但导入的数据中有memo类型,xp_cmdshell命令带的参数大于255,请问触发器能实现吗?
触发器如下:
CREATE TRIGGER TRIGGER_UP ON BTS_CURRENT_MALFUNTION
FOR insert
AS
declare @finish_T varchar(20)
declare @mal_type varchar(20)
declare @result varchar(200)
declare @note varchar(200)
declare @cmdstr varchar(800)
select @finish_T=reportdate,@mal_type=mal_typeid ,@result=service_result,@note=note from inserted
select @cmdstr='ReturnData.exe 0 '+@finish_t+' '+@mal_type+' '+@result+' '+@note
exec master..xp_cmdshell @cmdstr