How can we help you today? How can we help you today?

Cannot fake function created using WITH SCHEMABINDING

Most of our functions include WITH SCHEMABINDING which causes tests that attempt to fake them to fail with the message ' cannot be renamed because the object participates in enforced dependencies'.
Do you know of any way around this?

srichmond3000
0

Comments

1 comment

  • Eddie D
    Hi, thank you for your forum post.

    To be honest, I do not great answer to your question.  You may need to post your question on the tSQLt web site - https://tsqlt.org  or the tsqlt user group - https://tsqlt.org/join-the-conversation/ .

    The actual steps are Stored Procedures that you can copy and edit, which then can be run as a test that you have created.

    I suspect the only workaround to your problem, is to edit the Stored Procedure that tests the function or functions, remove the schema binding before the running the test that fakes the function.  When the test completes add back the schema binding to the function.   

    However, I have not tested the above, so please try against a test or development database before implementing any changes.

    Many Thanks
    Eddie
    Eddie D
    0

Add comment

Please sign in to leave a comment.