Table is probably included as part of some "schema binded" view. Use attached script to temporary remove schema binding.
Error:
"[Test] failed: (Error) A .NET Framework error occurred during execution of user-defined routine or aggregate "SuppressOutput":
System.Data.SqlClient.SqlException: Object '[dbo].[SomeTable]' cannot be renamed because the object participates in enforced dependencies."
Source on GIT
This is beautiful, thank you!
ReplyDeleteI have adapted this to make it work on objects that are not in the dbo schema, and to replace only the first occurrence of CREATE and WITH SCHEMABINDING in the object definition
See https://gist.github.com/DaveBoltman/2ad19779ccd5f95dd4a7a5d47fe914cb
It worked for me too. Many thanks.
ReplyDelete