我在 Visual Studio 2015 和 TFS 源代码控制中有一个带有 SSDT(SQL Server Data Tools)的数据库项目。
今天早上,当我试图比较两个数据库(DB -> TFS)时,它不起作用,我收到了一个错误:
Comparison completed. Difference detected. Restricted comparison. See error list for detail
在错误列表窗口警告是:
Severity Code Description Project File Line Suppression State Warning The login for the target does not have the VIEW ANY DEFINITION permission. The comparison will be restricted to database scoped elements if the source is a database.
SSDT 的 SQL Server 用户是
sa
.提前致谢
更新:
我通过以下查询修复了比较警告,但主要问题仍然存在:
USE [master]
GO
Grant VIEW ANY DEFINITION to [USERNAME];
GO
USE [DBNAME]
GO
GRANT CONNECT to [USERNAME]
GRANT VIEW DEFINITION TO [USERNAME]
最佳答案
我有一个 similar problem .虽然您没有字符串文字,但它可能仍在检查:
CR LF
) 或 unix ( LF
)。 sqlpackage.exe
提取 .dacpac
两个数据库,重命名为 .zip
,并比较两者的内容model.xml
's - 某处会有所不同。 关于sql-server - SSDT 和 TFS : compare SQL Server database not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40190590/