VS 2012 Database Project “unresolved reference to object” Error

后端 未结 9 1337
再見小時候
再見小時候 2020-12-16 09:02

I created SQL Server Database Project in VS 2012 & imported our database. When I build the project, I get a lot of \"unresolved reference to object\" Errors. These error

9条回答
  •  北海茫月
    2020-12-16 09:54

    This may be an edge case but if in your object definition you are also documenting the object (we do, anyway...) using sp_addextendedproperty you can also get this error if you have stated an incorrect object type - which can happen if copy & pasting. The "unresolved reference to object" error makes sense here when you think about it.

    For example the following will recreate the error as the level1type should be 'PROCEDURE' and not 'FUNCTION'.

    EXEC sp_addextendedproperty
      @name = N'MS_Description',
      @value = N'Description of the stored procedure...',
      @level0type = N'SCHEMA',
      @level0name = N'dbo',
      @level1type = FUNCTION',
      @level1name = N'spMyStoredProcedureName'
    GO
    

提交回复
热议问题