atlasdev
asked on
Unable to send email in SQL 2005
When I run test email in Database mail in SQL 2005 Management Studio, I got an error below
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Conne ctionInfo)
-------------------------- ----
ADDITIONAL INFORMATION:
Service Broker message delivery is not enabled in this database. Use the ALTER DATABASE statement to enable Service Broker message delivery. (Microsoft SQL Server, Error: 14650)
Can anyone tell me what I can do to resolve this?
Thanks.
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.Conne
--------------------------
ADDITIONAL INFORMATION:
Service Broker message delivery is not enabled in this database. Use the ALTER DATABASE statement to enable Service Broker message delivery. (Microsoft SQL Server, Error: 14650)
Can anyone tell me what I can do to resolve this?
Thanks.
http://msdn.microsoft.com/en-us/library/ms189959(v=SQL.90).aspx
ASKER
After reading the article, I think the problem in my issue is that my MSDB database's service broker is not enabled. I am trying to enable the service broker on MSDB database. I used the query below
USE master ;
GO
ALTER DATABASE AdventureWorks SET ENABLE_BROKER ;
GO
However, it takes forever to the query to finish. I think something is wrong here. When I checked the process info, I see the query's process wait type is LCK_M_X.
Is there something else I need to do to enable the service broker?
USE master ;
GO
ALTER DATABASE AdventureWorks SET ENABLE_BROKER ;
GO
However, it takes forever to the query to finish. I think something is wrong here. When I checked the process info, I see the query's process wait type is LCK_M_X.
Is there something else I need to do to enable the service broker?
Try running:
ALTER DATABASE msdb SET ENABLE_BROKER ;
instead of doing it in the AdventureWorks database
ALTER DATABASE msdb SET ENABLE_BROKER ;
instead of doing it in the AdventureWorks database
ASKER
Actually I am using ALTER DATABASE msdb SET ENABLE_BROKER. I forgot to change it in my previous post.
Its likely some other session is blocking your attempt to enable the service broker. Run the following in a new query window:
select blocking_session_id from sys.dm_exec_requests where session_id = SPID
where SPID is the sessionID of the query window trying to enable service broker.
select blocking_session_id from sys.dm_exec_requests where session_id = SPID
where SPID is the sessionID of the query window trying to enable service broker.
ASKER
I ran your query and see that SQLAgent-Alert Engine is the process blocking my query process.
ASKER
I tried to delete that process of SQLAgent-Alert Engine but it keeps coming back. I can restart the query again but the SQLAgent -Alert Engine keeps coming back at the same time, too.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much. The testing email is working now.