Out of nowhere, consistant query failures, SQL Azure USA South, Timeout expired. or TransientFailure exceptions..

Getting a bunch of SQL query failures since yesterday morning pacific time. Have not made changes to any code in months, and server load is about same as it has been for a year. Are you guys doing anything to SQL Azure? This is USA South.
This is a 20MB database and I'm doing queries on tables with couple thousand entities, shouldn't fail like this!
Using latest EntityFramework 6.1.1.
Fails at the SQL server no matter where I connect from.
Compiled Linq to Entity queries seem to be failing. The do have some .Includes..
These are the two most common issues:
System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to
completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception: The wait operation timed out
   --- End of inner exception stack trace ---
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<Reader>b__c(DbCommand t, DbCommandInterceptionContext`1 c)
   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
   at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
   at System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
   at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
and
System.Data.Entity.Core.EntityException: An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy. ---> System.Data.Entity.Core.EntityCommandExecutionException:
An error occurred while executing the command definition. See the inner exception for details. ---> System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing
connection was forcibly closed by the remote host.) ---> System.ComponentModel.Win32Exception: An existing connection was forcibly closed by the remote host
    --- End of inner exception stack trace ---
    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
    at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
    at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
    at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
    at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
    at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
    at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
    at System.Data.SqlClient.SqlDataReader.get_MetaData()
    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, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
    at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
    at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext)
    at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
    --- End of inner exception stack trace ---
    at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
    at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
    at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
    at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
    at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
    --- End of inner exception stack trace ---
    at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation)
    at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
    at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
    at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
    at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
    at System.Data.Entity.Core.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
    at System.Data.Entity.Core.Objects.CompiledQuery.Invoke[TArg0,TArg1,TResult](TArg0 arg0, TArg1 arg1)

Hi,
I’m writing to follow up with you on this post. Was the problem resolved after performing our action plan steps?If you are satisfied with our solution, I’d like to mark this issue as "Answered". That way, other community members could benefit from
your sharing.
Thanks,
Sofiya Li
Sofiya Li
TechNet Community Support

Similar Messages

  • SQL Azure: More Intermittent Timeouts

    Hi guys,
    We have a set of 5 online auction systems running on Windows Azure & SQL Azure. Each system consists of a single web worker and one or more web roles. Each system is using ASP.NET MVC 3 and Entity Framework, Repository Pattern and StructureMap.
    The worker role is responsible for housekeeping and runs two groups of processes. One group is run every ten seconds, the other every second. Each process will likely run a database query or stored procedure. These are scheduled with Quartz.net
    The web role serves the public interface and back office. Among other basic crud functionality, both of these provide screens which, when open, will repeatedly call controller methods which will result in execution of stored procedure read-only queries.
    The frequency of repetition is about 2-3 seconds per client. A typical use case would be 5 back office windows open, and 25 end user windows open – all hitting the system repeatedly.
    For a long time we have been experiencing intermittent SQL timeout errors. Three of the most common ones are:
    System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)
    System.Data.SqlClient.SqlException: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)
    System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    The only predictable scenario is during an auction where a specific controller -> sproc starts to timeout during the event (presumably due to load). All other times the errors appear to be completely random and come in singles, two’s, and three’s etc.
    even during periods of user inactivity. For example the system will go 18 hours without an error and then could be 5 – 10 errors from different housekeeping methods, or perhaps a user logged on and viewed their account.
    Other info:
    I have tried to run the affected queries/sprocs on SQL Azure using both local SSMS and Azure web-based query tool – all seem to execute quickly, 1 second max. Query plans not showing anything too suspicious although I am by no means a SQL query performance
    expert, or any other kind of expert for that matter
    J
    We have wrapped all affected areas in Azure SQL Transient Fault Handling Blocks – but as is discussed here
    http://social.msdn.microsoft.com/Forums/en-US/ssdsgetstarted/thread/7a50985d-92c2-472f-9464-a6591efec4b3, they do not catch timeouts, and according to “Valery M” this is for good reason.
    We are not storing any session information in the database, although asp.net membership information is stored in the database.
    We use 1 “SQL Azure server instance” which hosts all 5 databases, two for staging and three for production. All 5 systems are generally active at the same time although it is unlikely that more than one will be in a state of live load use at any given time.
    All web roles, worker roles and the SQL Azure server reside in the same Azure Geographical Region.
    Any thoughts on where we should be looking? Would it help giving each system it's own SQL Azure server? ... Failing a solution by ourselves - is it possible to get Microsoft to open a support ticket and take a look under the hood at what’s going on in with
    our application – how does one go about this?
    Thanks in advance.
    Ilan

    Ditto.
    New website/database (has only been in production for a week or so). The model we have is pretty simple Azure website MVC EF 6.1.1 using a single database in same region as website. I have monitored for and have never found any throttled connections or deadlocks.
    What I have tried so far
    I bumped the timeout in the connection string to 60 seconds
    I changed the web site to Basic and configured the auto scale to max instance size and count
    That seemed to help - but then just recently during points of high volume usage (client requests, data in and out, CPU time) I started seeing this error. As I narrow the focus to look at metrics during the exact time of the error it doesn't reflect
    the exact peak. For example peak usage may be at 3:45, but the errors occur at 4:30 when the usage is less than 3:45 by a fair amount.
    To try to force recreate and see if it was caused by transaction data table locks I ran a query in a transaction block with a WAITFOR delay and then went to the web site and tried to access data that would be locked by that query. That test did generate
    an error - but not this specific "semaphore timeout period has expired" - so I don't think it is caused by table locks.
    I did notice that when the error happens - it generally happens to one user and then happens multiple times to that one user over the course of what can be a minute or so and in different queries (views). The last analysis showed that pattern for
    one user with 2 other users getting the error but just once (and in different views/queries).
    USER A - got about 9 of these errors in about 8 different views over the course of a little more than a minute (20:26 to 21:35)
    USER B - got 1 (in the same timespan)
    USER C - got 1 (in the same time span)
    Analysis of the error logs showed it isn't unique to any single view/query or scenario wrt queries. The only clue that makes it less of an intermittent situation is does correspond with usage. However, it doesn't have to be specifically peak usage at the
    exact moment - but in a window (within an hour), It makes me wonder if it is the load or just the fact that more usage just increases the odds (I will monitor this relation some more and note the exact metrics). 
    I am now bumping the timeout in the connection string to 90 seconds and I have changed the database DTU setting to 50

  • Connection Failed SQL State: 'HYT00' SQL Server Error: 0 [Microsoft] [ODBC SQL Server Driver] Login Timeout expired

    I backed up  my database   on old Notebook    SQLSTRINGCONNECT worked all day  for any database in SQL SERVR I created
    have brand new computer  Notebook
    installed SQL SERVER 2008 THE EXACT SAME WAY
    I RESTORED THE DATABASE
    However, I cannot connect to it via Visual  FoxPro 9.0  with   SQLSTRINGCONNECT
    or even Windows 7    ODBC Data Source ADministrator

    Hi,
    We need more information as Olaf asked, but my first guess is that you have permissions problem since the users are not the same users in different machines (local users, or SQL Server users),
    even if they have the same name :-)
    [Personal Site] [Blog] [Facebook]

  • SQL Azure - query with row_number() executes slow if columns with nvarchar of big size are included

    I am linking my question from Stack Overflow here. The link: http://stackoverflow.com/questions/27943913/sql-azure-query-with-row-number-executes-slow-if-columns-with-nvarchar-of-bi
    Appreciate your help!
    Gorgi

    Hi,
    Thanks for posting here.
    I suggest you to check this link and optimize your query on sql azure.
    http://www.sqlusa.com/articles/query-optimization/
    http://sqlblog.com/blogs/paul_white/archive/2011/02/23/Advanced-TSQL-Tuning-Why-Internals-Knowledge-Matters.aspx
    Also check this blog which had similar issue.
    https://social.msdn.microsoft.com/Forums/en-US/c1da08b4-265d-4ec8-a252-8d7090234e3e/simple-select-query-takes-long-time-to-execute-with-nvarchar-columns?forum=transactsql
    Girish Prajwal

  • Why does a SQL Azure DACPAC upgrade (via a PowerShell script) consistently take 30min to complete

    I created a PowerShell script to upgrade a SQL Azure instance with my latest DACPAC (taken from http://msdn.microsoft.com/en-us/library/ee634742.aspx).
    What I have experienced when running my PowerShell script is that it consistently takes approximately 30min to execute. The script is idle for almost half an hour waiting on $dacstore.IncrementalUpgrade($dacName,
    $dacType, $upgradeProperties) to return from execution and nothing is printed out on the PowerShell console window. Only right at the end of the half hour does the incremental update start spitting out console messages which inform me that
    the upgrade is taking place (essentially it appears that the script has hung for 30min until it finally comes back alive and the script does this consistently every time).
    Does it usually take this long for the IncrementalUpgrade to complete and is there supposed to be a 30min period of inactivity/waiting?
    Note that I am running the PowerShell script from my local machine which is external to the Azure network.
    Thanks for any insight you can give for this, I am hoping that I can reduce this incremental upgrade process to substantially less than 30hr so that my continuous integration build doesn't take so long.

    Answer this post
    According to Microsoft Support this is a known issue and will be fixed in SQL Server 2012 (code named Denali). Here are the details from Microsoft Support:
    It’s a known issue that using SSMS 2008 or PowerShell to update DAC on SqlAzure is very slow. SQLServer 2008 utilize old extraction engine which run query for every column and small object. This way works well at on-premise server, and meets
    SQLServer 2008 original design target. However, when managing the SqlAzure database, the query need be transferred over internet, network latency makes the old extraction becomes inefficient, especially, when network is not good.
    Our SQL product team aware this issue and designed new extraction engine to fix it. The new engine is integrated in SQL Server 2012 (code name Denali). Unfortunately, some of the engine behavior may bring break changes to SQL Server 2008. We try
    different approach but we can’t relief regression barrier when apply the new engine in the SQL server 2008. Therefore, we don’t have plan to deliver the new extraction engine as hotfix on SQLServer 2008 so far. That will impact the current on-premise
    users and operation.

  • SQL Azure - Intermittent The wait operation timed out

    I have a website engine which runs a few hundred "white label" sites. It's hosted on Azure with a SQL Azure Business database. Generally everything is fine - it all works and runs at a good speed.
    However, throughout the day I get maybe 40 or 50 of the error:
    System.ComponentModel.Win32Exception: The wait operation timed out
    Please don't refer me to the connectivity blog at http://blogs.msdn.com/b/sqlazure/archive/2010/03/22/9982979.aspx as this seems to refer to problems where you just can't connect. My problem is that it's fine most of the time, but I still get these
    intermittently.
    This is sometimes on the main database, but we're also using a database for sessions and this gets the errors too. Both databases are on the same server.
    I also get errors like: 
    An existing connection was forcibly closed by the remote host
    and:
    System.Data.SqlClient.SqlException: The service has encountered an error processing your request. Please try again. Error code 40143. A severe error occurred on the current command. The results, if any, should be discarded.
    and, when evil bots are hammering the site:
    System.Data.SqlClient.SqlException: Resource ID : 1. The request limit for the database is 180 and has been reached. See 'http://go.microsoft.com/fwlink/?LinkId=267637' for assistance.
    Each website can potentially have a Google footprint of around 10,000 pages. The result it that bots are hitting the sites regularly, indexing lots of pages for hundreds of sites. I also have some worker roles doing data work. The database is clearly busy!
    I am hoping to add 2 or 3 times the number of sites that I currently have to the "engine". 
    I am looking at efficiency where possible, but the sites are clearly under a fair load from bots and visitors.
    My question is, will one of the upgrades from Business to S2, P1, P2 or P3 resolve these problems? The financial cost of these database instances stagger greatly so I wouldn't want to update and find I'm left with the same problems but am paying many times
    more each month.
    Thank you in advance.

    Hello,
    For Web/Business edition database, the maximum limit of concurrent requests is 180. Beyond this limit, you will receive error.
    The Max woker threads for Standard(S2) is 100, you should upgrade your database to Permium tier.
    The concurrent requests limit of premium database varies depending on the reservation size of a premium database. For example, for P1, the max worker threads is 200.
    Reference:Azure SQL Database Resource Governance
    Azure SQL Database Service Tiers and Performance Levels
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here. 
    Fanny Liu
    TechNet Community Support

  • SQL Azure: Query Analyzer VS Web Application - Calling Stored Prcocedure

    I have a stored procedure in SQL Azure.
    Calling this stored procedure normally would take 30 minutes.
    I need to call this Stored procedure multiple times (18 times, with different input)
    Scenario 1: When I call this asynchronously from the Web Application, all 18 calls run concurrently so the whole process take about 30 minutes.
    Scenario 2: When I call this same stored procedure from Microsoft SQL Server Management Studio, (each process in a different TAB) they seem to be running very slowly, it has already taken more than 5 hours.
    Is there a reason for this ?
    Is there any difference in calling multiple stored procedures from different tabs ?
    Is this process running Asynchronously ?
    What is the best was to achieve scenario without going via the front end ?

    Is there a reason for this ?
    --When you are running the query, no matter application or SQL Server, please check sys.dm_exec_requests and check the session status in SQL Server and see if any difference.
    Maybe it is caused by blocking when running in SSMS. We need to dig into it.
    I am not sure how you call the procedure asynchronously  in application, but if they are sent to SQL Server within different connections/sessions, then it should be the same as SSMS.
    Is there any difference in calling multiple stored procedures from different tabs ?
    --No.
    Is this process running Asynchronously ?
    --When you start the procedure in SSMS, it is a synchronize session.
    However, the slowness should not be associated with the synchronization or not.
    Per my understanding, for the asynchronously calling in application, it simply means that application goes to execution other code without for SQL Server.
    This does not affect the real time cost in SQL Server.
    What is the best was to achieve scenario without going via the front end ?
    --We need to understand what cause the issue first. Normally they should be almost the same.
    Right now the procedure caused 30 minutes to complete and it is really too long. I think you'd better make adjustment to the code or logic to tune the performance first.

  • Error Executing Database Query.coldfusion.sql.DatabaseConnectionException: Timed out trying to establish connection

    My coldfusion service crashes intermitantly and when I check
    the application logs the error that I see for the time frame is the
    one below. Does anyone know where I might begain to solve this?
    Thanks!
    Error Executing Database
    Query.coldfusion.sql.DatabaseConnectionException: Timed out trying
    to establish connection The specific sequence of files included or
    processed is: E:\wwwroot\lifeworks\default.cfm

    I'm no expert, but thought I would try to be helpful.
    I was getting this same error on a regular basis.
    The short term fix was to restart the ODBC server service.
    The long term fix was twofold:
    1. I recreated the ODBC connection in ColdFusion
    Administrator to use the system connection (I was using the SA and
    PW for login).
    2. I created a second user ODBC connection as well as the
    system one under ODBC in Windows Server 2003.
    I haven't had the problem since.
    I also read a pretty good set of "stuff" to try from the help
    area:
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_17277
    Hope this helps.

  • SQL Azure server instance

    I want to find out is how many SQL bulk operations can reliably be done at once on a SQL Azure server instance?
    Is there any capacity restrictions such as # of simultaneous bulk inserts, total # of rows per bulk operation,
    etc.?
    How should we handle multiple sql bulk operations to make this more reliable? Any best practices, recommendations

    Hi Rajesh,
    Based on your query, here is the link which answers all your questions.
    http://social.technet.microsoft.com/wiki/contents/articles/3507.windows-azure-sql-database-performance-and-elasticity-guide.aspx
    http://azure.microsoft.com/en-us/services/sql-database/
    http://msdn.microsoft.com/library/azure/hh852669.aspx
    Girish Prajwal

  • Using Entity Framework with SQL Azure - Reliability

    (This is a cross post from http://stackoverflow.com/questions/5860510/using-entity-framework-with-sql-azure-reliability since I have yet to receive any replies there)
    I'm writing an application for Windows Azure. I'm using Entity Framework to access SQL Azure. Due to throttling and other mechanisms in SQL Azure, I need to make sure that my code performs retries if an SQL statement has failed. I'm trying to come up with
    a solid method to do this.
    (In the code below, ObjectSet returns my EFContext.CreateObjectSet())
    Let's say I have a function like this:
      public Product GetProductFromDB(int productID)
         return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
    Now, this function performs no retries and will fail sooner or later in SQL Azure. A naive workaround would be to do something like this:
      public Product GetProductFromDB(int productID)
         for (int i = 0; i < 3; i++)
            try
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault();
            catch
    Of course, this has several drawbacks. I will retry regardless of SQL failure (retry is waste of time if it's a primary key violation for instance), I will retry immediately without any pause and so on.
    My next step was to start using the Transient Fault Handling library from Microsoft. It contains RetryPolicy which allows me to separate the retry logic from the actual querying code:
      public Product GetProductFromDB(int productID)
         var retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(5);
         var result = _retryPolicy.ExecuteAction(() =>
               return ObjectSet.Where(item => item.Id = productID).SingleOrDefault;
         return result;
    The latest solution above is described as ahttp://blogs.msdn.com/b/appfabriccat/archive/2010/10/28/best-practices-for-handling-transient-conditions-in-sql-azure-client-applications.aspx Best Practices for Handling Transient Conditions in SQL Azure Client
    Application (Advanced Usage Patterns section).
    While this is a step forward, I still have to remember to use the RetryPolicy class whenever I want to access the database via Entity Framework. In a team of several persons, this is a thing which is easy to miss. Also, the code above is a bit messy in my
    opinion.
    What I would like is a way to enforce that retries are always used, all the time. The Transient Fault Handling library contains a class called ReliableSQLConnection but I can't find a way to use this with Entity Framework.
    Any good suggestions to this issue?

    Maybe some usefull posts
    http://blogs.msdn.com/b/appfabriccat/archive/2010/12/11/sql-azure-and-entity-framework-connection-fault-handling.aspx
    http://geekswithblogs.net/iupdateable/archive/2009/11/23/sql-azure-and-entity-framework-sessions-from-pdc-2009.aspx

  • SQL Azure very slow

    Hi Experts
    We have SQL Azure database that is running very slow, so i took a backup of the database and restored on my on premise sql server express edition. 
    I tried a update statement on a logs tables that have approximately about 1,062,367 records.
    UPDATE logs set FileId = NULL
    where LEN(FileId) < 36
    The above update statement updates about 910,593 records on localhost host in 20 sec and if i run the same updates statement on SQL Azure it took 40mins and 16sec. The update statement was issues using SQL Server management studio installed on my local machine.
    With reference to internet connection, we have fiber connection with download speed of 70.62mbps and upload speed of 84.09mbps 
    I am not sure whats going wrong with SQL Azure database i.e. could there be a specific fault on my database at Microsoft side etc.
    Any advice or suggestion will be highly appreciated.
    Kind Regards
    Bhavesh
    Bhavesh

    I have waited for 40 min for the update to complete and it has successfully and updated logs table so i can't re-run the update statement again because there will be no records to update.
    I have managed to find another example that took about 10 mins to complete on the SSMS but when ran the same query on the azure management portal it took only 6 secs which puzzled me. 
    Here is the query: 
    select   
     l.Value3 as ClientReference,
     l.[Key] as ActivityUser,
     l.Value2 as FormDisplayName,
     l.Value6 as Status,
     l.DateStamp as LastUpdated,
     l.[Action] as FileDescription,
     l.CompanyId as ClientID,
     l.FileId as FileID,
     f.id
    from Logs l
    LEFT OUTER JOIN files f on f.Id = l.FileId 
    where l.AccountId = 578
    and type = 1
    The above query returns about 3694 records only.
    Here is the details of the query performance 
    Azure Management Portal
    Duration(ms): 6487
    CPU(ms): 2443
    Logical Reads: 74729
    Physical Reads: 66147
    Logical Writes: 0
    SSMS
    Duration(ms): 615259
    CPU(ms): 3666
    Logical Reads: 74729
    Physical Reads: 71370
    Logical Writes: 0
    Any update will be appreciated.
    Bhavesh

  • How to add description of a column of a table in SQL Azure

    Hi
    I have some tables in my application database where there are descriptions added against certain columns. Needless to say they were done by using sp_addextendedproperty.
    Now I am trying to migrate the Database to SQL Azure. SQL Azure does not support sp_addextendedproperty.
    Hence I am not able to figure out how to add descriptions to those columns.
    Any help would be much appreciated.
    Thanks
    Soumyadeb

    Hello,
    Just as Latheesh post above, Windows Azure SQL database are not support extended stored procedures. That’s one of the limitations on SQL database, and I don’t know there is another way to achieve the same on Azure.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Cannot refresh data in Excel Services with SQL Azure databases

    I am using Excel Services on a SharePoint Online.
    I get my data from a SQL Azure. When i create my Excel repor with Excel 2013 pro I have no problem. So I upload my file on my Sharepoint and try to refresh data.
    Connexion : Power Query - RPT_Event_ByEventType 
    Erreur : Erreur sur site (OnPremise) : Sorry, the data source for this data connection isn't registered for Power BI. Ask your Power BI
    admin to register the data source in the Power BI admin center. 
    I do not understad why I get that error because my data source is on Azure why It told me "OnPremise" ?

    hi,
    >> this button of excel gets just address of web and have button for import it
         i test it by rest API project , but doesn't work, do you know how it is work?
    Do you mean that you don't know how to get the table? You may input the site address into the address box, and then click go button nearby, select the table you want to import into the Excel. Then click import button.That also works for  rest API,
    and your rest API should get the data that you want
    By the way, this is the forum for discussions about Excel develop(VBA ,customization), better to go to TechNet forum for Excel for Excel features question, so that you could get more professional help.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Performance is too slow on SQL Azure box

    Hi,
    Performance is too slow on SQL Azure box (Located in Europe)
    Below query returns 500,000 rows in 18 Min. on SQL Azure box (connected via SSMS, located in India)
    SELECT * FROM TABLE_1
    Whereas, on local server it returns 500,000 rows in (30 sec.)
    SQL Azure configuration:
    Service Tier/Performance Level : Premium/P1
    DTU       : 100
    MAX DB Size : 500GB     
    Max Worker Threads : 200          
    Max Sessions     : 2400
    Benchmark Transaction Rate      : 105 transactions per second
    Predictability : Best
    Any suggestion would be highly appreciated.
    Thanks,

    Hello,
    Can you please explain in a little more detail the scenario you testing? Are you comparing a SQL Database in Europe against a SQL Database in India? Or a SQL Database with a local, on-premise SQL Server installation?
    In case of the first scenario, the roundtrip latency for the connection to the datacenter might play a role. 
    If you are comparing to a local installation, please note that you might be running against completely different hardware specifications and without network delay, resulting in very different results.
    In both cases you can use the below blog post to assess the resource utilization of the SQL Database during the operation:
    http://azure.microsoft.com/blog/2014/09/11/azure-sql-database-introduces-new-near-real-time-performance-metrics/
    If the DB utilizes up to 100% you might have to consider to upgrade to a higher performance level to achieve the throughput you are looking for.
    Thanks,
    Jan 

  • Restriction to Left Outer Joins in PS Query

    Hello I am trying to do Left Outer JOin in PS QUERY. I need to do dept tbl, job code tbl and locatable as left outer joins with JOB Table. Looks like in PS QUERY there is a error message saying as below. Can someone has any workaround to achieve this in PS QUERY. I know I can create a View and use that in PS QUERY but BUsiness Users are dependent on IT, so that doesn't work. Also, adding JOB table multiple times works but I am looking for better solution if anyone had come accorss working through PS QUERY Outer JOins.
    Windows Internet Explorer
    Left outer joins must be joined to the last record in the query. (139,290)
    OK
    Thanks,
    SC.

    Hi Mike,
    According to your description, you want to improve the performance for your DAX query in SQL Server Analysis Service Tabular model, right? Here is a white paper describes strategies and specific techniques for getting the best performance from your tabular
    models, including processing and partitioning strategies, DAX query tuning, and server tuning for specific workloads.
    http://msdn.microsoft.com/en-us/library/dn393915.aspx
    Since this is a complex DAX query, from a support perspective this is really beyond what we can do here in the forums. If you cannot determine your answer here or on your own, consider opening a support case with Microsoft. Visit this link to see the various
    support options that are available to better meet your needs:
    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone
    Regards,
    Charlie Liao
    TechNet Community Support

Maybe you are looking for

  • IPhoto library DVD won't open after installing iLife '06

    Apple Care recently prompted me to erase and reinstall. After doing so, I installed iLife '06. My iPhoto library was backed up to a DVD. How do I now import those photos into my new iPhoto? When I insert the DVD, I get the message "You can't open you

  • Search and Replace String throwing the wrong error message with regexp?

    This came up in a LAVA thread, and I'm not sure if there's a bug here or not. When using Search and Replace string, and using a regular expression of [(G[b|i])], LabVIEW throws error -4622, "There is an unmatched parenthesis in a regular expression."

  • Cintiq 21ux Color Issue with Snow Leopard

    I just recently upgraded to Snow Leopard from Tiger. I have a Cintiq 21ux tablet that is noticeably "faint" now on the new SL. It appears hazy and the colors just don't pop like they did on Tiger. I didn't have this issue with Tiger. Does anyone have

  • Running an ActiveX component wrapped as a Java Applet. How to do it?

    I have a legacy ActiveX/ocx plugin that the client wants to be run as a Java Applet. They think that will make things J2EE compliant. How would you wrap that? are there libraries to help? Thanks in advance

  • UWL Zip Configuration Upload "Unable to read file"

    Hi Folks, System Info: NW AS 7.02 JAVA Stack 702 Level 16 Background: We're using the UWL for our Workflow based Approval Process in SAP FI-TV (Travel Management). For this we've been using the standard UWL configuration File com.sap.pct.erp.mss.tra