Error - Column name or number of supplied values does not match table definition

  • jsshivalik

    SSC-Addicted

    Points: 491

    Hi

    ALTER procedure [dbo].[GST_Report_GSTR3B_APAR_Test](
    @fromDate date,
    @toDate date,
    @locGSTN nvarchar(15))
    as
    begin

    IF object_id('GST_Report_GSTR3B_APAR_Tab','u') is not null
    drop table GST_Report_GSTR3B_APAR_Tab

    select t0.*
    into GST_Report_GSTR3B_APAR_Tab
    from (select case when ObjType = 14 then -BaseSum
    else BaseSum end as BaseSum,
    case when ObjType = 14 then -IGSTSum
    else IGSTSum end as IGSTSum,
    case when ObjType = 14 then -CGSTSum
    else CGSTSum end as CGSTSum,
    case when ObjType = 14 then -SGSTSum
    else SGSTSum end as SGSTSum,
    case when ObjType = 14 then -CessSum
    else CessSum end as CessSum,
    'GR' as ItemTaxType ,CardName,DocEntry,DocNum,DocDate,LocGSTN
    from GST_ODOC_Result_Ignore_RvsCharge t0
    where ObjType in (13, 14)
    and (ItemTaxType <> 'GE' and PureNilRateDoc = 'N')
    and not (ImpOrExp = 'Y' and ExportType <> 'D')
    ) t0
    insert into GST_Report_GSTR3B_APAR_Tab
    select case when ObjType = 14 then -BaseSum
    else BaseSum end as BaseSum,
    case when ObjType = 14 then -IGSTSum
    else IGSTSum end as IGSTSum,
    case when ObjType = 14 then -CGSTSum
    else CGSTSum end as CGSTSum,
    case when ObjType = 14 then -SGSTSum
    else SGSTSum end as SGSTSum,
    case when ObjType = 14 then -CessSum
    else CessSum end as CessSum,
    'ZZ' as ItemTaxType ,CardName,DocEntry,DocNum,DocDate,LocGSTN
    from GST_ODOC_Result_Ignore_RvsCharge
    where ObjType in (13, 14)
    and (ItemTaxType <> 'GE' and PureNilRateDoc = 'N')
    and ImpOrExp = 'Y' and ExportType <> 'D'

    End

    Thanks

  • Phil Parkin

    SSC Guru

    Points: 243910

    Is this a blog post, or do you have a question?

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

  • jsshivalik

    SSC-Addicted

    Points: 491

    Question

  • Phil Parkin

    SSC Guru

    Points: 243910

    jsshivalik wrote:

    Question

    My mind-reading capabilities are lacking today, so please state your question here.

    By the way, questions end with a question mark (?)

    If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply