SQL Server 2016AT TIME ZONE
似乎是不确定的。但是,我一直无法找到正式说明这一点或对其背后的推理给出理由的文档。
为什么是AT TIME ZONE
不确定的?
执行:
CREATE TABLE Test (
LegacyTimestamp DATETIME,
Timestamp AS LegacyTimestamp AT TIME ZONE 'Eastern Standard Time' PERSISTED
);
Run Code Online (Sandbox Code Playgroud)
返回以下错误:
Msg 4936, Level 16, State 1, Line 1
Computed column 'Timestamp' in table 'Test' cannot be persisted because the column is non-deterministic.
Run Code Online (Sandbox Code Playgroud) 当 SQL Server 使用 SQL Launchpad 启动外部运行时(例如 R 或 Python)时sp_execute_external_script
,外部运行时进程的生命周期是多少?
每个sp_execute_external_script
脚本执行是否都有自己的外部流程实例,或者外部流程是否会一直存在,直到它在一段时间内处于非活动状态(例如,如果我使用相同的 SQL 会话执行以相同语言编写的另一个脚本,则现有流程可能会被重用) )?
为什么 SQL Server 会默默地无法重新启用外键约束?
我最近尝试使用ALTER TABLE
. 大多数成功启用;然而,少数约束仍被 报告为禁用sys.foreign_keys
。
例子:
ALTER TABLE [dbo].[Table] WITH CHECK NOCHECK CONSTRAINT FK_ConstraintName;
-- Command(s) completed successfully.
SELECT is_disabled FROM sys.foreign_keys
WHERE name = 'FK_Constraint' AND parent_object_id = OBJECT_ID('[dbo].[Table]');
-- returns "1", indicating that the constraint is still disabled
Run Code Online (Sandbox Code Playgroud)