Timeline for Is it possible to run a query for EVERY DDL change that occurs in a server?
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 6, 2022 at 12:35 | comment | added | J.D. | Regarding your reply to SMor's original suggestion, you don't have to do something 200 times, it is possible to write code that deploys a change to all 200 databases but you only have to run such code once. That can be achieved in either pure SQL leveraging things like dynamic SQL or a better version of sp_MSforeachdb (e.g. by Aaron Bertrand) or whatever procedural programming language you prefer to iterate over each database. | |
Jan 6, 2022 at 12:01 | comment | added | SMor | You have your answer - it is possible just not in a way that you desire. But this sounds like a big XY problem. Specifically you have management issues with people changing schemas without any sort of control (and documentation). A schema should be source-controlled. In addition a developer is likely to make many changes to a particular object over time as s/he refines the object and its design/usage. Surely you don't want useful notifications for that? | |
Jan 6, 2022 at 10:50 | comment | added | Dan Guzman | Have you considered the default trace or a XE trace? | |
Jan 6, 2022 at 7:58 | comment | added | Tibor Karaszi | Then use event notifications. A server level EN can capture database level events. mssqltips.com/sqlservertip/2121/… | |
Jan 6, 2022 at 7:56 | comment | added | Ali EXE | @stickybit, I know about that. This means that on a server that has more than 200 databases, I need to do something 200 times. I'm looking for something that is at the server-level. | |
Jan 6, 2022 at 6:54 | comment | added | sticky bit | You can implement DDL triggers on the databases. | |
Jan 6, 2022 at 6:45 | history | asked | Ali EXE | CC BY-SA 4.0 |