Skip to content

Latest commit

 

History

History
86 lines (65 loc) · 3.27 KB

alter-message-type-transact-sql.md

File metadata and controls

86 lines (65 loc) · 3.27 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
ALTER MESSAGE TYPE (Transact-SQL)
ALTER MESSAGE TYPE (Transact-SQL)
markingmyname
maghan
03/06/2017
sql
t-sql
reference
ALTER_MESSAGE_TYPE_TSQL
ALTER MESSAGE TYPE
ALTER MESSAGE TYPE statement
modifying message types
message types [Service Broker], modifying
TSQL

ALTER MESSAGE TYPE (Transact-SQL)

[!INCLUDE SQL Server - ASDBMI]

Changes the properties of a message type.

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

ALTER MESSAGE TYPE message_type_name  
   VALIDATION =  
    {  NONE   
     | EMPTY   
     | WELL_FORMED_XML   
     | VALID_XML WITH SCHEMA COLLECTION schema_collection_name }  
[ ; ]  

[!INCLUDEsql-server-tsql-previous-offline-documentation]

Arguments

message_type_name
The name of the message type to change. Server, database, and schema names cannot be specified.

VALIDATION
Specifies how [!INCLUDEssSB] validates the message body for messages of this type.

NONE
No validation is performed. The message body might contain any data, or might be NULL.

EMPTY
The message body must be NULL.

WELL_FORMED_XML
The message body must contain well-formed XML.

VALID_XML_WITH_SCHEMA = schema_collection_name
The message body must contain XML that complies with a schema in the specified schema collection. The schema_collection_name must be the name of an existing XML schema collection.

Remarks

Changing the validation of a message type does not affect messages that have already been delivered to a queue.

To change the AUTHORIZATION for a message type, use the ALTER AUTHORIZATION statement.

Permissions

Permission for altering a message type defaults to the owner of the message type, members of the db_ddladmin or db_owner fixed database roles, and members of the sysadmin fixed server role.

When the ALTER MESSAGE TYPE statement specifies a schema collection, the user executing the statement must have REFERENCES permission on the schema collection specified.

Examples

The following example changes the message type //Adventure-Works.com/Expenses/SubmitExpense to require that the message body contain a well-formed XML document.

ALTER MESSAGE TYPE  
    [//Adventure-Works.com/Expenses/SubmitExpense]  
    VALIDATION = WELL_FORMED_XML ;  

See Also

ALTER AUTHORIZATION (Transact-SQL)
CREATE MESSAGE TYPE (Transact-SQL)
DROP MESSAGE TYPE (Transact-SQL)
EVENTDATA (Transact-SQL)