Hello,
I am having trouble with this update statement. I am trying to use a select statement in the WHERE clause of the update statement. I am not sure if i am missing something. I am also getting this other error incorrect syntax near the end of file. Can you please tell me what I am doing wrong?
CREATE TRIGGER UpdateStatusLevel ON Customer FOR UPDATE AS BEGIN UPDATE Customer SET StatusLevel = 'Regular' WHERE CustomerID = SELECT COUNT(o.CustomerID) FROM [Order] AS o INNER JOIN inserted i on o.CustomerID = i.customerID INNER JOIN Customer c on c.customerID = o.CustomerID WHERE o.CustomerId >= 2;
Thanks,