WordTechinc
Programmer
- Sep 4, 2009
- 38
Error 213: Insert Error: Column name or number of supplies values does not match table definition. Insert Error: Column name or number of supplies values does not match table definition.
I am getting Error 213 after add ClassKey Varcgar(20)in table @LicenseID_ProfCode. Please help me.
Declare @LicenseID_ProfCode table
(
LicenseID numeric(11),
RankOrder int,
ProfCode char(4),
StudentID numeric(18),
ZipCode Varchar(10),
ClassKey NVARCHAR(20)
)
Insert into @LicenseID_ProfCode (LicenseID,StudentID,ProfCode,RankOrder,ZipCode,ClassKey)
SELECT DISTINCT LicenseMaster.LicenseID,LicenseMaster.StudentID,INRv2_ProfCodeRelation.ProfCode,RankOrder,LicenseMaster.ZipCode,INR_Attendee.ClassKey
From [INR_LicenseMaster] LicenseMaster
INNER JOIN INR_Attendee ON left(LicenseMaster.zipcode,5) = left(INR_Attendee.zipcode,5)
INNER JOIN @ClassTab ClassTab ON INR_Attendee.ClassKey = ClassTab.ClassKey
INNER JOIN @SSCodeTab SSCodeTab ON LicenseMaster.state = SSCodeTab.SSCode
INNER JOIN @INRV2_LicenseStatus LicenseStatus
ON LicenseStatus.status=LicenseMaster.LicStatus
INNER JOIN @NCOAHitCodeTAB NCOAHitCodeTAB
ON NCOAHitCodeTAB.NCOAHitCode=ISNULL(LicenseMaster.NCOAHitCode,'M')
INNER JOIN
INRv2_ProfCodeRelation
ON LicenseMaster.LicenseID=INRv2_ProfCodeRelation.LicenseID
INNER JOIN
INR_ProfCodeMaster
ON INRv2_ProfCodeRelation.ProfCode=INR_ProfCodeMaster.ProfCode
INNER JOIN INR_Terms T ON INRv2_ProfCodeRelation.DSCode=T.DSCode AND INRv2_ProfCodeRelation.TimesUsed < T.NoOfuses AND GetDate() < T.ExpirationDate
WHERE
DPBC is not null and (NeverUSA <> 'N'or NeverUSA is null)
and UsedStatus='Y'
order by LicenseMaster.LicenseID
I am getting Error 213 after add ClassKey Varcgar(20)in table @LicenseID_ProfCode. Please help me.
Declare @LicenseID_ProfCode table
(
LicenseID numeric(11),
RankOrder int,
ProfCode char(4),
StudentID numeric(18),
ZipCode Varchar(10),
ClassKey NVARCHAR(20)
)
Insert into @LicenseID_ProfCode (LicenseID,StudentID,ProfCode,RankOrder,ZipCode,ClassKey)
SELECT DISTINCT LicenseMaster.LicenseID,LicenseMaster.StudentID,INRv2_ProfCodeRelation.ProfCode,RankOrder,LicenseMaster.ZipCode,INR_Attendee.ClassKey
From [INR_LicenseMaster] LicenseMaster
INNER JOIN INR_Attendee ON left(LicenseMaster.zipcode,5) = left(INR_Attendee.zipcode,5)
INNER JOIN @ClassTab ClassTab ON INR_Attendee.ClassKey = ClassTab.ClassKey
INNER JOIN @SSCodeTab SSCodeTab ON LicenseMaster.state = SSCodeTab.SSCode
INNER JOIN @INRV2_LicenseStatus LicenseStatus
ON LicenseStatus.status=LicenseMaster.LicStatus
INNER JOIN @NCOAHitCodeTAB NCOAHitCodeTAB
ON NCOAHitCodeTAB.NCOAHitCode=ISNULL(LicenseMaster.NCOAHitCode,'M')
INNER JOIN
INRv2_ProfCodeRelation
ON LicenseMaster.LicenseID=INRv2_ProfCodeRelation.LicenseID
INNER JOIN
INR_ProfCodeMaster
ON INRv2_ProfCodeRelation.ProfCode=INR_ProfCodeMaster.ProfCode
INNER JOIN INR_Terms T ON INRv2_ProfCodeRelation.DSCode=T.DSCode AND INRv2_ProfCodeRelation.TimesUsed < T.NoOfuses AND GetDate() < T.ExpirationDate
WHERE
DPBC is not null and (NeverUSA <> 'N'or NeverUSA is null)
and UsedStatus='Y'
order by LicenseMaster.LicenseID