SQL Server Error 1098: Fix Event Type Issue
In this article
SQL Server error 1098, which typically reads "The specified event type %s is/are not supported," occurs when you try to create or alter an event notification or a DDL trigger using an event type that SQL Server does not recognize or that is not valid in that context. The fix is to use a supported event type name from the official list (for example, CREATE_TABLE, ALTER_TABLE, DROP_TABLE) and ensure it is spelled correctly and applicable to the target database or server scope. This guide walks you through the steps to resolve the error and get your event notification or trigger working.
What You'll Need
- Access to SQL Server Management Studio (SSMS) or another client that can run T-SQL.
- Permissions to create or alter event notifications or DDL triggers (typically ALTER ANY EVENT NOTIFICATION or CONTROL SERVER for server-scoped objects, and ALTER ANY DATABASE EVENT NOTIFICATION or CONTROL DATABASE for database-scoped objects).
- The exact event type name you intend to use, verified against the official list of DDL event types supported by your SQL Server version.
Step-by-Step
- Identify the failing statement. Look at the error message and the T-SQL batch that produced it. Error 1098 usually appears when you run
CREATE EVENT NOTIFICATION,ALTER EVENT NOTIFICATION, orCREATE TRIGGER ... FOR / AFTERwith an event type that SQL Server does not support. Note the exact event type name you supplied. - Check the spelling and case. Event type names are not case-sensitive in most cases, but they must match the documented names exactly. A common mistake is using
CREATE_TABLEinstead ofCREATE_TABLE(which is correct) or misspellingALTER_TABLEasALTER_TABEL. Verify each character. - Confirm the event type is valid for the scope. Some event types are valid only at the database scope, others only at the server scope. For example,
CREATE_TABLEis a database-level event and cannot be used in a server-scoped event notification. If you are creating a server-level event notification, use server-level event types such asCREATE_DATABASEorALTER_DATABASE. Conversely, database-level notifications cannot use server-level events. Check the official documentation for the list of events supported at each scope. - Use the correct syntax for event notifications. The general syntax for creating an event notification is:
Ensure that theCREATE EVENT NOTIFICATION event_notification_name ON { SERVER | DATABASE | QUEUE queue_name } [ WITH FAN_IN ] FOR event_type [ , ...n ] TO service_broker_target ;FORclause lists only supported event types. If you are creating a DDL trigger, the syntax is:
Again, verify that each event type in the list is valid for the specified scope.CREATE TRIGGER trigger_name ON { DATABASE | ALL SERVER } [ WITH <trigger_option> [ , ...n ] ] { FOR | AFTER } { event_type [ , ...n ] | event_group } AS { sql_statement } - Query the supported event types. You can use the
sys.event_notification_event_typescatalog view to list all event types that can be used in event notifications. Run:
For DDL triggers, you can querySELECT * FROM sys.event_notification_event_types ORDER BY name;sys.trigger_event_typesto see the event types available for triggers. Compare your event type against these lists. - Correct the event type and re-run the statement. Replace the invalid event type with a valid one from the list. If you need to capture multiple events, separate them with commas. For example, to capture table creation and alteration at the database scope:
If the error persists, double-check that the service broker target exists and that you have the necessary permissions.CREATE EVENT NOTIFICATION MyNotification ON DATABASE FOR CREATE_TABLE, ALTER_TABLE TO SERVICE 'MyService', 'current database'; - Test the notification or trigger. After successful creation, perform the action that should fire the event (for example, create a table) and verify that the notification or trigger works as expected. You can check the event notification log or the trigger's output.
Common Mistakes
- Using a server-level event in a database-scoped object. For instance, specifying
CREATE_DATABASEin a database-level event notification will raise error 1098 because that event is only valid at the server scope. - Misspelling the event type. Names like
CREATE_TABLEare easy to mistype. Always copy from the official list. - Forgetting to include the
ON DATABASEorON SERVERclause. Omitting the scope can lead to syntax errors or the wrong scope being assumed, which may then cause an invalid event type error. - Assuming all DDL events are available for triggers. Some events are only available for event notifications, not for DDL triggers. Check the appropriate catalog view for the object type you are creating.
- Not accounting for version differences. Event types available can vary between SQL Server versions. If you are using an older version, some newer event types may not be supported.
Tips
- Use
sys.event_notification_event_typesto quickly find the exact spelling and scope of an event type. Thetype_namecolumn gives the name to use in your statement. - When creating event notifications, consider using event groups (like
DDL_TABLE_EVENTS) instead of individual events to simplify management and avoid spelling issues. - Always test your event notification or trigger in a development environment before deploying to production.
- Keep a script of your event notification definitions so you can easily recreate them if needed.
Troubleshooting
If you still encounter error 1098 after following the steps above, try these checks:
- Verify the event type is not deprecated or removed. Check the documentation for your specific SQL Server version to see if the event type is still supported.
- Check for hidden characters or trailing spaces. Copying event type names from documentation can sometimes include non-printing characters. Retype the name manually.
- Ensure you are using the correct statement type. Error 1098 can also appear if you use
CREATE EVENT NOTIFICATIONsyntax for a DDL trigger or vice versa. Confirm you are using the right command. - Review permissions. Lack of permissions usually produces a different error, but in some cases, insufficient permissions can cause misleading errors. Ensure you have the necessary rights.
- Look for additional error messages. Sometimes error 1098 is accompanied by other errors that provide more context. Check the complete error output.
Frequently Asked Questions
What does error 1098 mean in SQL Server?
Error 1098 indicates that the event type you specified in an event notification or DDL trigger is not supported. It typically reads "The specified event type %s is/are not supported."
How do I find the correct event type name?
Query the sys.event_notification_event_types catalog view for event notifications, or sys.trigger_event_types for DDL triggers. The type_name column contains the valid names.
Can I use multiple event types in one statement?
Yes, you can list multiple event types separated by commas in the FOR clause, as long as each is valid for the scope.
Why does my event type work in one database but not another?
Event types are scoped. Some are valid only at the server level, others only at the database level. Ensure you are using the correct scope for your event type.
Is error 1098 related to Service Broker?
Not directly. Error 1098 is about the event type, not the Service Broker target. However, event notifications require Service Broker to be enabled, so ensure that is configured if you are creating event notifications.
What if I need to capture an event that is not listed?
If the event is not listed in the catalog views, it is not available for event notifications or DDL triggers. You may need to use other mechanisms such as SQL Trace or Extended Events.