Why does this SQL work in VS but not in code?
- by acidzombie24
The line cmd.ExecuteNonQuery();
cmd.CommandText
CREATE TRIGGER subscription_trig_0 ON subscription
AFTER INSERT AS
UPDATE user_data
SET msg_count = msg_count + 1
FROM user_data
JOIN INSERTED ON user_data.id = INSERTED.recipient;
The exception:
Incorrect syntax near the keyword 'TRIGGER'.
Then using VS 2010, connected to the very same file (a mdf file) i run the query above and i get a success message.