none
SQL71501: Function: [loinc].[FnLoincPartsAndPartTranslationsBegin] has an unresolved reference to object RRS feed

  • Question

  • I am trying to set up a SSDT project that is comprised of 3 databases. I have created 3 projects in a solution. In the main project I have added DB references to the other two projects.

    However, I try to build the main project I get errors of the form:

    Error 174 SQL71501: Function: [loinc].[FnLoincPartsAndPartTranslationsBegin] has an unresolved reference to object [loinc].[BeginPartSyn]. D:\TFS\LOINC\SQLServer\REGI_LOINC_PROD\REGI_LOINC_PROD\loinc\Functions\FnLoincPartsAndPartTranslationsBegin.sql

    The error is in a function that is using a synonym.

    SELECT   
       [PART_NUM] AS NUM,   
       [TYPE],   
       [PART] AS FORMAL_NAME,   
       [DISPLAY_NAME],   
       @version as VERSION  
    FROM [loinc].[BeginPartSyn]

    I'm not sure why it resolve the reference because the synonym is defined in the same DB project. The synonym definition contains the following:

     CREATE SYNONYM [loinc].[BeginPartSyn] FOR [$(REGI_LOINC_Archive)].[246].[PART];

    I have read many posts about 3 part references in SSDT. So as you can see above, I have used a DB variable to reference the other project but this didn't help.


    I am using:

    Microsoft Visual Studio Ultimate 2013
    Version 12.0.40629.00 Update 5
    Microsoft .NET Framework
    Version 4.6.01055

    SQL Server Data Tools   12.0.60629.0
    Microsoft SQL Server Data Tools

    Any assistance would be greatly appreciated.
    John


    John

    Friday, August 19, 2016 4:00 PM

All replies

  • It might help you.

    You need to create the Schema as well, as a separate SSDT object. It will not be automatically created for you just by specifying that you want to use it for your SQLCLR objects. You should be able to:                                                                                                                                          http://stackoverflow.com/questions/34770688/vs-sqlclr-function-x-has-unresolved-reference-to-schema-y


    Please click Mark As Answer if my post helped.


    • Edited by AV111 Friday, August 19, 2016 7:04 PM
    Friday, August 19, 2016 7:04 PM
  • Thanks for the suggestion. I followed the instructions on stackoverflow and ended up with a new file named loinc.sql. As described in the referenced thread, it contained a single line: "CREATE SCHEMA [loinc]"

    Unfortunately, when I do a build I still get the same errors.

    I will note that the stackoverflow thread is discussing a CLR project. My projects do have any CLR components. They are strictly DB functions and synonyms. I don't know if makes a difference, but I thought worth mentioning.

    Thanks again for the suggestion!


    John

    Friday, August 19, 2016 8:47 PM