将 VS 2019 Professional 升级到最新版本 16.10.0。打开一个已有的SSDT工程,双击工程中任意一个sql脚本文件,在tab窗口中无法打开该文件。
如果 sql 脚本定义了一个表,我可以看到消息:设计图面正在加载。我可以看到设计和脚本表面之间的分隔符。如果我拖动分隔符来调整曲面的大小,窗口会刷新并且脚本将正确打开。
如果 sql 脚本定义了视图或存储过程,我只会看到空白的选项卡窗口。我没有看到任何消息。
如果我重新启动 VS2019,之前打开的脚本工作正常。但是每当我想打开一个在重新启动之前没有打开的脚本时,仍然是同样的问题。
有谁知道如何自定义VS Code中的文件浏览器窗口颜色主题?另外如何自定义行号的颜色?
例如,当使用内置的高对比度颜色主题时,我可以看到文件浏览器和行号颜色不同.但是在使用扩展颜色主题时,我找不到一种自定义颜色的方法,比如材质主题.
尝试在存储过程中使用 SQL Server 2016 STRING_SPLIT 函数。它在 SSMS 中解析正确。但在SSDT(最新版本)中,该函数无法解析,因此项目无法编译。有人知道如何解决这个问题吗?谢谢。
我的SQL Server数据库项目中有许多临时表。今天,我将我的SSDT升级到最新版本,并且在构建项目时遇到了以下临时表错误。例如,我有一个时态表UseCase,该表具有一个称为UseCase_HISTORY的历史表。
它看起来像一个代码分析问题。如果在构建时禁用代码分析,则构建时将不会出现错误。
我正在使用VS2015和VS2017。两者都有相同的问题。
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(1292,5): Error: SQL72039: The substring is out of the bounds for script MSSQL::dbo.UseCase_HISTORY.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(1292,5): Error: MSB4018: The "SqlStaticCodeAnalysisTask" task failed unexpectedly.
Microsoft.Data.Tools.Schema.SchemaModel.ScriptCacheException: The substring is out of the bounds for script MSSQL::dbo.UseCase_HISTORY.
at Microsoft.Data.Tools.Schema.SchemaModel.ScriptCache.CheckAndGetSubstring(String cacheIdentifier, Int32 startOffset, Int32 length, CachedString value)
at Microsoft.Data.Tools.Schema.SchemaModel.ScriptCache.GetScript(String cacheIdentifier, Int32 startOffset, Int32 length)
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSourceInformation.ParseSource()
at Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlSourceInformation.get_ScriptDom()
at Microsoft.SqlServer.Dac.Model.SqlSchemaModelObjectService.GetOriginalSourceFragment(TSqlObject tSqlObject)
at Microsoft.SqlServer.Dac.TSqlModelUtils.TryGetFragmentForAnalysis(TSqlObject tSqlObject, TSqlFragment& fragment)
at Microsoft.SqlServer.Dac.CodeAnalysis.SqlRuleExecutionContext.get_ScriptFragment()
at Microsoft.SqlServer.Dac.CodeAnalysis.Rules.Design.DataTypeCompatibilityRule.Analyze(SqlRuleExecutionContext context)
at Microsoft.SqlServer.Dac.CodeAnalysis.Engine.RuleEngine.TryExecuteSingleRule(RuleDescriptor ruleDescriptor, …Run Code Online (Sandbox Code Playgroud) 我有一个 SQL Server 时态表“person”,其记录如下:
name | modified_by
-------------------------
John | 1
Run Code Online (Sandbox Code Playgroud)
如果我执行以下sql语句
update person set modified_by = 2 where name = 'John'
delete from person where name = 'John'
Run Code Online (Sandbox Code Playgroud)
我在历史表中看到两条记录,分别为modified_by = 1和2。
如果我在一个事务中执行这两条语句
begin transaction
update person set modified_by = 2 where name = 'John'
delete from person where name = 'John'
commit transaction
Run Code Online (Sandbox Code Playgroud)
我在历史表中只看到一条带有modified_by = 1的记录
这是预期的行为吗?为什么?
我刚刚安装了最新的 Visual Studio 2019。我可以打开我的 SQL 数据库项目。但是当我尝试打开 SQL 脚本文件时,出现错误:
Failed to create an editor. Value cannot be null. Parameter name: Password.
Run Code Online (Sandbox Code Playgroud)
知道如何修复它吗?
我有一张像
ID VALUE
-------------
1 0.5
2 0.3
3 1.6
4 5.5
5 0.8
6 0.8
7 0.2
Run Code Online (Sandbox Code Playgroud)
我想编写一个查询来找出 VALUE 小于当前行 VALUE 的行数。例如,对于行 ID 5,总行数应为 3(ID 1、2、7)。所以查询结果可能是这样的
ID VALUE LessThanCount
------------------------------
1 0.5 2
2 0.3 1
3 1.6 5
4 5.5 6
5 0.8 3
6 0.8 3
7 0.2 0
Run Code Online (Sandbox Code Playgroud)
我正在开发最新的 MS SQL Server。