Test scalar function with linked server in it

DavidPaulsenDavidPaulsen Posts: 3
edited April 21, 2015 7:20AM in SQL Test
Hello,

i am faking a table on an external SQL Server (same SQL Server, another Instance) with installed tsqlt Framework, through a linked Server.
I am able to fake the table and insert, update and delete rows to/from it.

Now i am trying to test a scalar Function with the same linked Server in it and the test Fails and i am getting the following errormessage:

Msg 3933, Level 16, State 1, Line 1
Cannot promote the transaction to a distributed transaction because there is an active save point in this transaction.


Question:
Is it possible to test the way i tried? It is very important to test this (and a lot of other) function with the linked Server in it.
It is not possible to Change the linked Server handling right now, because there a lot of Systems (many of them 3rd Party) which are using These functions (and also the linked Server).

Any Suggestion will be appreciated :-)

Comments

  • I just want to inform you, that we have found a solution for this.

    We wrote a Stored Procedure to alter a Function (or Stored Procedure) and replace a search string with a replace string.
    So we are able to alter the objects with linked Servers to objects without linked Servers.
    The search string is the linked Server and it will be replaced with an empty string.
    This is no Problem in Development, because the Databases are on the same SQL Instance.
    But we cannot alter the Objects permanently, because in Production the Databases were on different SQL Instances.
  • How do I get the list of test that are already in the database. The tSQLt framework is already installed in this database as well?
    dolii
  • Anu DAnu D Posts: 876 Silver 3
    Thanks for your post!

    I have logged a support ticket for you and will get back to you shortly!
    Anuradha Deshpande
    Product Support
    Redgate Software Ltd.
    E-mail: support@red-gate.com
Sign In or Register to comment.