SQL Server Notification: Cannot find the user ''owner''

  • I am having the following error trying to get a SQL Notification to work. I have followed the "Creating a Query for Notification" at http://msdn2.microsoft.com/en-us/library/ms181122.aspx, but so far without success in resolving this.

    Source:

    .Net SqlClient Data Provider

    Data:

    System.Collections.ListDictionaryInternal

    Message:

    Cannot find the user 'owner', because it does not exist or you do not have permission.

    Cannot find the queue 'SqlQueryNotificationService-ed992b36-32d5-44d9-ad40-311e70ce8978',

    because it does not exist or you do not have permission.

    Invalid object name 'SqlQueryNotificationService-ed992b36-32d5-44d9-ad40-311e70ce8978'.

    StackTrace:

    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

    at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)

    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

    at SqlDependencyProcessDispatcher.SqlConnectionContainer.CreateQueueAndService(Boolean restart)

    at SqlDependencyProcessDispatcher.SqlConnectionContainer..ctor(SqlConnectionContainerHashHelper hashHelper, String appDomainKey, Boolean useDefaults)

    at SqlDependencyProcessDispatcher.Start(String connectionString, String& server, DbConnectionPoolIdentity& identity, String& user, String& database, String& queueService, String appDomainKey, SqlDependencyPerAppDomainDispatcher dispatcher, Boolean& errorOccurred, Boolean& appDomainStart, Boolean useDefaults)

  • The problem turned out to be that after setting up the notfication as in MSDN example at

    http://msdn2.microsoft.com/en-us/library/62xk7953.aspx, I had omitted the equivalent line to

    command.ExecuteReader(); // Execute the command.

    Once I added this line, the notifications started working!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply