日期:2014-05-17 浏览次数:20520 次
select @sql=' declare @accountid varchar(50) '
select @sql=@sql+' select top 1 @accountid=accountid from '+@DTTable+' a with(nolock) '
select @sql=@sql+' left join v_faccount b with(nolock) on a.companyid=b.companyid and a.accountid=b.acctcode '
select @sql=@sql+' where isnull(a.currency,'''')<>isnull(b.currency,'''') and a.doccode='''+@doccode+''' and
( left(a.accountid,4) in(''1001'',''1002''))'
select @sql=@sql+' if isnull(@accountid,'''')<>'''''
select @sql=@sql+' begin raiserror(''科目:%s币种与科目设置不一致!'',16,1,@accountid) return end '
exec (@sql)