Which Transact-SQL statement must you execute before creating the BasicService service?

Correct Answer for the following Question is given below

You are a database developer on an instance of SQL Server 2008. You are creating an application that will use Service Broker objects to send and receive messages. You want to create a service named BasicService that will allow both conversation participants to send and receive messages of the DEFAULT type.Which Transact-SQL statement must you execute before creating the BasicService service?A queue stores the incoming message for the service. Each service must be associated with a queue. Therefore, you must create a queue using the CREATE QUEUE statement before creating a service. After creating the queue, you can execute the CREATE SERVICE statement. The basic syntax of the CREATE SERVICE statement is as follows:CREATE SERVICE service_name [AUTHORIZATION owner_name]ON QUEUE [schema_name.]queue_name [(contract_name | [DEFAULT])[,…n ]];The AUTHORIZATION clause identifies the owner of the service. The ON QUEUE clause specifies the queue that the service will use to store messages and any contracts that define the allowed message types. You must specify a value for the ON QUEUE clause to associate the service with a message queue. ServiceBroker uses the service name to identify the queue used for the service. When creating a service, specifying one or more contracts is optional. If you omit the contract name(s), the service can only start a conversation. If you use the DEFAULT contract, both conversation participants will be able to send and receive messages of the DEFAULT type.The basic steps to create a Service Broker application that sends and receives messages between two services are as follows:1. Create message types using CREATE MESSAGE TYPE statements.2. Create contracts using CREATE CONTRACT statements.3. Create the queue to store messages using the CREATE QUEUE statement.4. Create the services using CREATE SERVICE statements.5. Begin a conversation between the two services using the BEGIN DIALOG CONVERSATION statement.6. Send and receive messages using the SEND and RECEIVE statements, respectively.You do not have to execute the CREATE CONTRACT statement. You use the CREATE CONTRACT statement to create a contract. A contract defines the message types that are allowed and the conversation participants that can send messages. However, you can create a service without specifying a contract or using the DEFAULT contract. For example, the following statement creates a contract that allows the conversation initiator to send messages of the BasicMessageType type:CREATE CONTRACT BasicContract (BasicMessageType SENT BY INITIATOR);You do not have to execute the CREATE BROKER PRIORITY statement. The CREATE BROKER PRIORITY statement is used to create a conversation priority level that Server Broker uses to prioritize conversations. The statement includes the criteria that Service Broker uses to determine the conversation’s priority. When you have conversations prioritized, you can use the GET CONVERSATION GROUP statement to determine the conversation group that has the highest priority.You do not have to execute the CREATE ROUTE statement. The CREATE ROUTE statement creates a route that specifies how Service Broker will locate services on other computers or in other databases.

Question:

Which Transact-SQL statement must you execute before creating the BasicService service?

Options:

CREATE CONTRACT

CREATE BROKER PRIORITY

CREATE QUEUE

CREATE ROUTE

Correct Answer

The Correct Answer for this Question is

CREATE QUEUE

Explanation

The Question – Which Transact-SQL statement must you execute before creating the BasicService service? has been answered correctly and answers for the question is CREATE QUEUE

More about these Exams

These Exam Questions and the order of these questions keep changing. but the answers are obviously same. so if you don’t find a question after another we suggest you search it in the search box and we are sure you’ll find it. you can bookmark this site for Quick access in future.

We hope you found it helpful don’t forget to leave a comment if you feel a need to correct or ask we’re always here to help.

you can find more here at Certout

Feel free to contact via comment or email.

Happy Learning

Cheers, Team Certout

Leave a Comment