About the first trigger, it looks just fine and id it does what is required, then it should be ok. If you like, you can simplify it a bit, for example:
Create TRIGGER trgCustomerInsert
ON Customer
FOR INSERT AS
INSERT INTO CustomerLog (CustomerLogID, CustomerID, Email, LogDate)
SELECT 'CustomerLogID', TheCustomerID, Email, GetDate()
FROM inserted
About the second trigger, if the problem is how to update another table just like you insert into another table. Could you describe a bit more what's the desired behavior?
ADDITION:
Based on your comment, you shouldn't use the second trigger on Product table. If the CustomerOrderItem entry is subtracting the qauntity, then your trigger could be something like:
Create TRIGGER trgCustomerOrderItem
ON CustomerOrderItem
FOR INSERT, UPDATE AS
UPDATE Product SET QTY = QTY - (SELECT SUM(QTY) FROM inserted)
WHERE here define the condition for correct product based on CustomerOrderItem???
So you reduce the quantity of the product based on the inserted rows. I didn't see any product information on CustomerOrderItem table so I didnät know the joining condition for the update. Perhaps it's in the Order table.
The triggers are just like for example a stored procedure, a bunch of T-SQL statements that are run when the triggering action occurs. Few links you should go through:
-
DML Triggers[
^]
-
CREATE TRIGGER[
^]
-
Multirow Considerations for DML Triggers[
^]