473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Trigger ISSUE

10
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
Feb 27 '08 #1
1 1093
ck9663
2,878 Expert 2GB
I think that means CreateByUser does not accept NULL value. That could happen on your INSERT. Since, the UPDATE is manipulating an existing row and CreateByUser is not on your UPDATE sql. I can only assume that would be on your INSERT. In it you specified certain columns and CreateByUser is not on it. Maybe you need to include it.

Happy Coding

-- CK
Feb 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matik | last post by:
Hello to all, I have a small question. I call the SP outer the DB. The procedure deletes some record in table T1. The table T1 has a trigger after delete. This is very importand for me, that...
18
by: Bill Smith | last post by:
The initial row is inserted with the colPartNum column containing a valid LIKE pattern, such as (without the single quotes) 'AB%DE'. I want to update the column value with the results of a query...
4
by: Paul Reddin | last post by:
Hi, Having just tested our database on V8.2 we get the following apparent incompatibility. A Trigger conatains the following line CREATE TRIGGER JABS.AU_CHNG_ENQUIRYITM AFTER UPDATE OF ..
3
by: Ricardo Corsi | last post by:
Hi, It is possible to call a trigger (inside a sql server..) with asp.net ? how can i do that ? thks!
2
by: niradjoshi | last post by:
I made two SQL Server 2000 as linked server using same remote login These both server are running on different Domain Configuration Detail 1. Server A - MS SQL Server 2000 SP4, windows 2003...
9
by: steven | last post by:
Does anyone know how to do the following. I'm trying to mimic replication with triggers. I have 2 databases, each have these 2 tables. 1. USERS ID int NAME varchar(20)
2
by: dean.cochrane | last post by:
I have inherited a large application. I have a table which contains a hierarchy, like this CREATE TABLE sample_table( sample_id int NOT NULL parent_sample_id int NOT NULL ....lots of other...
6
by: wugon.net | last post by:
Hi , Anyone know how to monitor db2 trigger activity ? We suffer some trigger issue , and we try to monitor trigger's behavior use event monitor and db2audit, but both tools can not get...
1
by: candide_sh | last post by:
hello, I googled around some time but I found no solution for this issue (SS2000). I have a table tblB which has to be filled whenever in another table tblA records are inserted, updated or...
11
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG'...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.