Reputation: 2582
I have a SQL Azure database with a stored procedure that is returning just one row with 10 columns.
If I execute this stored procedure in Azure it takes 4 minutes.
Then I copied the database in local via dacpac file. So the database is exactly the same right?
When I executed the same stored procedure locally, then it takes less than 1 seconds.
Any idea? Can't be the network latency.
Upvotes: 5
Views: 1337
Reputation: 2582
Erland Sommarskog solved my problem on msdn. So the solution was UPDATE STATISTICS by runnning "EXEC sp_updatestats" on the Database.
And the running time is now 1 seconds instead 4 min...
Upvotes: 5