I am trying to execute stored procedure on the database MSSQL. It is throwing invalid column name. But I have column in my table.
How to fix this.
Unexpected error running Liquibase: Invalid column name ‘Account_number’. [Failed SQL: (207) Create or ALTER PROCEDURE [dbo].[account_auto_details]
The code is below.
–liquibase formatted sql
–changeset bob:121 runOnChange:true splitStatements:false stripComments:false
Create or ALTER PROCEDURE [dbo].[account_auto_details]
UPDATE fw_tran
SET fw_tran.Account_person = isnull(T.Account_person,-1),
fw_tran.Account_number = isnull(T.Account_number,-1)
FROM #Intermediate (nolock) T
cross apply ( select fw_tran.Account_person,fw_tran.Account_number,fw_tran.qw_gr_key,fw_tran.qwTransaction
from swtich_tran (nolock) fw_tran where fw_tran.qwTransaction =(select max(fw_tran_b.qwTransaction)
from swtich_tran (nolock) fw_tran_b where fw_tran_b.qwTransaction <= T.qwTransaction
and fw_tran_b.qw_gr_key = T.qw_gr_key ) and fw_tran.qw_gr_key = T.qw_gr_key ) fw_tran