I have a problem that i cant seem to find out why i am getting this error when updating table I am get error saying cant in NULL in field name CreateByUser.
I am using a INSTEAD OF INSERT Trigger. This trigger is triggered from a store procedure with the information is transfer via a XML file. The insert of a new record is done without any problem. Can someone help Below is the update code
BEGIN
UPDATE Customer
SET CustomerCode=@CustomerCode,CustomerIdentificationT ype=@CustomerIdentificationType ,
CustomerIdentificationGroupCode=@CustomerIdentific ationGroupCode,DocumentNumber=@DocumentNumber,
FirstName=@FirstName,LastName=@LastName,MiddleName =@MiddleName,
CustomerName=@CustomerName,ContactPerson=@ContactP erson,ContactTitle=@ContactTitle,
Country=@Country,ParishOrState=@ParishOrState,Dist rictOrCity=@DistrictOrCity,CommunityOrTownShip=@Co mmunityOrTownShip,
Street=@Street,TelephoneNumbers=@TelephoneNumbers, CellPhoneNumbers=@CellPhoneNumbers,
EmailAddress=@EmailAddress,Photo=@Photo,CustomerCa tegory=@CustomerCategory,
CustomerIdentificationIssuingInstitution=@Customer IdentificationIssuingInstitution,
CustomerIdentificationIssuingCountry=@CustomerIden tificationIssuingCountry,CustomerIdentificationExp irationDate=@CustomerIdentificationExpirationDate,
CustomerIdentificationCategory=@CustomerIdentifica tionCategory,Comments=@Comments,Occupation=@Occupa tion,DateofBirth=@DateofBirth,
TaxRegistrationNumber=@TaxRegistrationNumber,LastT radeDate=@LastTradeDate,LastTradeValue=@LastTradeV alue,
LastTradeType=@LastTradeType,TraderAssignedToAccou nt=@TraderAssignedToAccount,DiscountPuchaseTrade=@ DiscountPuchaseTrade,
DiscountSaleTrade=@DiscountSaleTrade,MinimumPuchas eTradeValueForDiscount=@MinimumPuchaseTradeValueFo rDiscount,
MinimumSaleTradeValueForDiscount=@MinimumSaleTrade ValueForDiscount,Active=@Active,CompanyCode=@Compa nyCode,LocationCode=@LocationCode,
BranchCode=@BranchCode,OwnerCode=@OwnerCode,DateTi meCreated=@DateTimeCreated,DateTimeModified=@DateT imeModified,
CreatedByUser=@CreatedByUser,ModifiedByUser=@Modif iedByUser,SourceOfFunds=@SourceOfFunds
WHERE CustomerCode = @CustNum
END
IF @@ROWCOUNT <> 0
BEGIN
INSERT INTO
SysDatabase_Transactions( Record_Id,TableName,Operation,TransferDateTime)
SELECT b.CustomerCode,'Customer','U',Getdate()
FROM Inserted b
END