• Okay we will go step by step.

    First what is the out put that you are seeing for this statement

    select '[' + name + '] = 0,'

    from sys.columns

    WHERE object_id = OBJECT_ID(N'[dbo].[ArCustomerBal]')

    and name != ' @sx_customer_code'