title: Azure SQL server error Statement 'RECEIVE MSG' is not supported in this version of SQL Server
body: <p>I have used SQLdependency with SignalR to show alerts to users.. The code is as follows:</p>
  
  <pre><code>public IEnumerable&lt;AlertInfo&gt; GetData(long UserId)
  {
      using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["yafnet"].ConnectionString))
      {
          connection.Open();
          using (SqlCommand command = new SqlCommand(@"SELECT [AlertID],[AlertNote],[AlertDetails],[AlertDate],[Location]
        FROM [dbo].[Alerts] where [UserID]=" + UserId + " AND [IsViewed]=0", connection))
          {
              // Make sure the command object does not already have
              // a notification object associated with it.
              command.Notification = null;
              SqlDependency.Stop(ConfigurationManager.ConnectionStrings["yafnet"].ConnectionString);
              SqlDependency.Start(ConfigurationManager.ConnectionStrings["yafnet"].ConnectionString);
  
              SqlDependency dependency = new SqlDependency(command);
              dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
  
              if (connection.State == ConnectionState.Closed)
                  connection.Open();
  
              using (var reader = command.ExecuteReader())
                  return reader.Cast&lt;IDataRecord&gt;()
                      .Select(x =&gt; new AlertInfo()
                      {
                          AlertID = x.GetInt64(0),
                          AlertNote = x.GetString(1),
                          AlertDetails = x.GetString(2),
                          AlertDate = x.GetDateTime(3),
                          Location = x.GetString(4)
                      }).ToList();
          }
      }
  }
  </code></pre>
  
  <p>It is working fine on localhost. But after uploading to Azure server, this method throws the following error:</p>
  
  <blockquote>
    <p>Message":"An error has occurred.","ExceptionMessage":"Statement 'RECEIVE MSG' is not supported
     in this version of SQL Server.","ExceptionType":"System.Data.SqlClient.SqlException","StackTrace":"
    \r\nServer stack trace: \r\n   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception
    , Boolean breakConnection, Action`1 wrapCloseInAction)</p>
  </blockquote>
  
  <p>What could be the issue?</p>