0

We paid $150 to Autotask (now Datto) for a backup / export of our PSA data which they provided in the format of a .BAK file which is an SQL database.

We need to extract data from the Autotask PSA assets' user-defined fields (UDFs) so, in a disposable VM, I have:

  1. Installed Microsoft SQL Server 2017 Express (latest) and the Microsoft SQL Server Management Studio (SSMS).
  2. Restored the database using the BAK file.
  3. Determined that the data we need can be retrieved by using the view dbo.wh_installed_product_udf.
  4. Found that executing query select * from wh_installed_product_udf / select * from dbo.wh_installed_product_udf fails with the following error messages:

 

Msg 4121, Level 16, State 1, Procedure wh_installed_product_udf, Line 1 [Batch Start Line 0]
Cannot find either column "dbo" or the user-defined function or aggregate "dbo.fnSafeNumericConvert", or the name is ambiguous.

Msg 4413, Level 16, State 1, Line 1
Could not use view or function 'wh_installed_product_udf' because of binding errors.

I have not been able to find a solution to this online, hence this post.

1 Answers1

0

We determined that the root cause was that the dependant function fnSafeNumericConvert no longer existed for some reason and worked around it by doing the following in SSMS:

  1. Right-clicking on the view dbo.wh_installed_product_udf → clicking on Design.
  2. Copying the query (SELECT etc).
  3. Removing any and all lines that contain fnSafeNumericConvert (in our case, MAX(CASE udf_value_installed_product.udf_field_id WHEN 29682891 THEN dbo.fnSafeNumericConvert(decimal_value) ELSE NULL END) AS Number_of_Licenses_as_numeric,).
  4. Manually executing the remaining query.