问题简述,select 的为mysql数据库里面的数据,要将符合条件的数据插入到sqlserver数据库中,由于参数要有灵活性,所以不能写死,(假如写一个数字参数:6552是可以的换成变量就不行了),这个变量怎么写才正确?
谢谢各位看看,感谢各位看官跃跃发言。
问题如下,
存储过程如下:
alter procedure [dbo].[proc_inserttblcdribx10000119]
@crdid int
as
insert into dbo.tbl_cdr_ibx1000_0119(cdr_id,billindex,caller,called,connected,begintime,endtime,inphychannel,outphychannel,identification,remark,timelength,queueofcaller,queueofcalled,queueofconnected)
select id,billindex,caller,called,connected,begintime,endtime,inphychannel,outphychannel,calltype,outtype,timelength,queueofcaller,queueofcalled,queueofconnected
from openquery(mysql,'select * from tbl_pbx_bill where id > @crdid' )
