question

Bhupendra99 avatar image
Bhupendra99 asked

Scenarios for The definition of object has changed since it was compiledd

Can anybody pls tell me what are the different scenarios due to which we get below error The definition of object has changed since it was compiled
recompilation
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

what is the object? Stored proc, trigger, ... ?
0 Likes 0 ·

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
It appears to be occurring primarily when you're altering objects in a table within a transaction and you alter the objects in an order that effectively would result in deadlocks if you were manipulating data. So, for example, you disable a trigger and then attempt to alter it as part of a single transaction. There [are examples here][1]. It's directly related to the fact that you can get statement level recompiles, but if you alter objects that will also cause a recompile event. Best to break up whatever script you have into more discrete behaviors. [1]: https://connect.microsoft.com/SQLServer/feedback/details/224946/
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.