Answer the question
In order to leave comments, you need to log in
How to properly create triggers (T-SQL)?
Hello!
On the Internet, including MSDN itself, I could not find a suitable example of a request for creating a trigger - some kind of error always gets out.
For example, I'm trying to create an audit for the "players" table and already on the first line I get an error:
The "players" table exists, there are fields in it. It's even full.
What is the problem and how to solve it?
Answer the question
In order to leave comments, you need to log in
Try to specify the table name in full: db_name.dbo.players. Management Studio exports the created triggers in this form.
most likely management studio has not yet updated the cache and does not know about the presence of the table.
try CTRL + SHIFT + R - Refresh.
SQL Server Management Studio Keyboard Shortcuts
1. The table players
exists in the same schema - dbo
?
2. Collation base case insensitive? If not: the table is called players
, not Players
(or plAyers
, etc) ;) ?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question