|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
错误信息:
-2147217900
列名 'cAccountNumber' 无效。
执行如下语句时出错:
Declare @cVer varchar(100)
set @cVer = (select cValue from accinformation where cSysId='AA' and cID='99')
if @cVer < '8.60'
begin
--升级Bank
--将网上银行账户信息档案的数据追加到公共的开户银行档案中:若[银行账号]已存在,
--则用网上银行账户信息的其它属性更新记录(若同一[银行账号]存在多条记录,则应同时更新多条记录的属性),
--其中,原[开户银行]字段将被覆盖为网上银行的字段内容;若[银行账号]不存在,则将网上银行账户信息追加到表中,
--由系统自动写入一个不重复的[编码](编码唯一性规则),
--若[注销日期]<=系统日期,[是否暂封]=True,若[注销日期]>系统日期,[是否暂封]=False
declare @cBCode varchar(100)
declare @cAccountNumber varchar(100)
declare @cAccountName varchar(100)
declare @cBankId varchar(100)
declare @cBankName varchar(100)
declare @cBankAddress varchar(100)
declare @cPrinvince varchar(100)
declare @cCity varchar(100)
declare @cMoneyType varchar(100)
declare @cBankCode varchar(100)
declare @mBalance float
declare @iProperty tinyint
declare @dOpenDate datetime
declare @dCancelDate datetime
declare @bBflag bit
declare @i int
set @i=1
declare @bContinue bit
set @bContinue=1
declare Rst cursor for select cAccountNumber,cAccountName,cBankId,cBankName,cBankAddress,cPrinvince,cCity,cMoneyType,cBankCode,mBalance,iProperty,dOpenDate,dCancelDate from NB_Account
Open Rst
 fetch next from Rst into @cAccountNumber,@cAccountName,@cBankId,@cBankName,@cBankAddress,@cPrinvince,@cCity,@cMoneyType,@cBankCode,@mBalance,@iProperty,@dOpenDate,@dCancelDate
 while @@fetch_status=0
 begin
  if (@dCancelDate>getdate() ) or @dCancelDate is null
  set @bBFlag=0
  else
  set @bBFlag=1
  if exists(select top 1 cBAccount from bank where cBAccount=@cAccountNumber)
  update bank set cBName=@cBankName,bBFlag=@bBFlag,cBankCode=@cBankId,cAccName=@cAccountName,cOpenAccAddr=@cBankAddress,fCurBalance=@mBalance,dOpenAccDate=@dOpenDate,cCode=@cBankCode,iAccProperty=@iProperty,cCurrencyName=@cMoneyType,cProvinceName=@cPrinvince,cCountyName=@cCity where cBAccount=@cAccountNumber
  else
  begin
  while @bContinue=1 
  begin
  set @cBCode=right('000'+convert(varchar(3),@i),3)
  begin
  if not exists(select top 1 cBCode from bank where cBCode=@cBCode)
  set @bContinue=0
  else
  set @bContinue=1
  end
  set @i=@i+1
  end
  set @bContinue=1
  insert into bank(cBCode,cBName,cBAccount,bBFlag,cBankCode,cAccName,cOpenAccAddr,fCurBalance,dOpenAccDate,cCode,iAccProperty,cCurrencyName,cProvinceName,cCountyName)values(@cBCode,@cBankName,@cAccountNumber,@bBFlag,@cBankId,@cAccountName,@cBankAddress,@mBalance,@dOpenDate,@cBankCode,@iProperty,@cMoneyType,@cPrinvince,@cCity)
  end
  fetch next from Rst into @cAccountNumber,@cAccountName,@cBankId,@cBankName,@cBankAddress,@cPrinvince,@cCity,@cMoneyType,@cBankCode,@mBalance,@iProperty,@dOpenDate,@dCancelDate
 end
close Rst
deallocate Rst
End |
|