Suppress SSDT database reference error

  • In database projects, VS2015, I want to create some views for me database that will reference another database table using 3 part naming reference.

    Works fine in SSMS but when I try and build me project I is throwing up a reference error.

    I can't import the other database into this project, so is there a way to suppress the error? I don't really want to exclude these view from the project.

    Thanks,

  • you have to create synonyms for anything that points to objects outside of the database.

    the synonym will have deferred resolution,and your project will compile correctly, as you replace each three part reference with a synonym.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Ah good thought.

    I thought i I created one to cover it it would try an evaluate that also and kick up an error.

    I'll give it a go!

    Thanks buddy

  • Nope, still getting a unresolved reference to object error when i try the build. Has this worked for you?

  • can you change the location of the data that the view is referring to?

    Even adding a task to move the data and then apply the amended view to test if this is the issue.

  • The view works fine when deployed manually. I think i am going to have to create a dacpac and reference that

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply