无法捕获Exec执行的错误信息!
Set @SQLStr= 'Delete from ['+@TargetServer+'].'+@SourceDB+'.dbo.tbQSD Where pk_recpid='''+@pk_recpid+'''
Insert Into ['+@TargetServer+'].'+@SourceDB+'.dbo.tbQSD Select * from dbo.tbQSD Where pk_recpid='''+@pk_recpid+'''
Delete from ['+@TargetServer+'].'+@SourceDB+'.dbo.tbClientCHInOut Where SourceBill='''+@pk_recpid+'''
Insert Into ['+@TargetServer+'].'+@SourceDB+'.dbo.tbClientCHInOut Select * from dbo.tbClientCHInOut Where SourceBill='''+@pk_recpid+''' '
Print(@SQLStr)
Exec(@SQLStr)
If @@Error>0
Begin
Select @ReStatus=2, @ReMsg='插入错误'
return
End