VS 2010 build database project receive SQL04151

后端 未结 4 549
鱼传尺愫
鱼传尺愫 2021-01-11 10:32

I just started working with the Visual Studio 2010 Premium database project. I must say it does indeed rock. One thing I can\'t figure out is how to avoid the SQL04151 warni

相关标签:
4条回答
  • 2021-01-11 11:01

    MS has acknowledged this as a bug they are working on:

    https://connect.microsoft.com/VisualStudio/feedback/details/543657/4151-unresolved-reference-warning-for-tempdb

    0 讨论(0)
  • 2021-01-11 11:09

    In your [dbo].[MyProc] procedure you reference [MyDatabase].[dbo].[MyItem] which is probably not part of your DB project. Even though the object exists in the DB, it is not known to Visual Studio during compilation and thus yields an error.

    Normally you should have the entire DB-schema in the DB-project. Otherwise I think there is something called "partial DB projects" that you can look into.

    0 讨论(0)
  • 2021-01-11 11:18

    I need to substitute [MyDatabase].[dbo].[MyTable] with [$(DatabaseName)].[dbo].[MyTable]. This cleared up the warnings.

    Thanks for your help.

    0 讨论(0)
  • 2021-01-11 11:21

    Check you have set Build Action to Build on Properties pane for the specified object..

    0 讨论(0)
提交回复
热议问题