LOck Timout Azure SQL

jatin pathak 111 Reputation points

I am running is job in Azure Runbook for the SQL Database and it is failing with error "Lock request time out period exceeded." . Wondering how can i control/change this value in Azure . Can I change this in Azure SQL connection string ? what is the default value ?

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 33,176 Reputation points MVP

    Call a stored procedure from Azure Automation that perform all you want.

    Try using

    SET LOCK_TIMEOUT -1 inside the stored procedure.

    Before each transaction and statements.

    When running the stored procedure from Azure Azutomation set the timeout to zero.

    $DatabaseCommand = New-Object System.Data.SqlClient.SqlCommand
    $DatabaseCommand.CommandType = [System.Data.CommandType]::StoredProcedure
    $DatabaseCommand.Connection = $DatabaseConnection
    # A value of 0 indicates no limit
    $DatabaseCommand.CommandTimeout = 0
    $DatabaseCommand.CommandText = $SP
    0 comments No comments