Normally I like solving things on my own, but i started SQLServer not too long ago and it's giving me a headache.
Anyways, the question was to Write a trigger that will Place 'No First Name' in any record added to the customerEmployee
table that has a NULL
for the EmpFirstName
field.
What I have been done was:
`CREATE TRIGGER noFirstName `
`ON dbo.CUSTOMEREMPLOYEE`
`FOR INSERT, UPDATE AS`
<code>print 'No First Name'</code>
Then I wrote another query to test it out but it returns me an error that says:
Cannot insert the value NULL into column 'TITLE', table 'Chapter8.dbo.CUSTOMEREMPLOYEE'; column does not allow nulls. INSERT fails.
The statement has been terminated.
Can anyone see what is wrong?