我正在使用SQL Server 2017,并尝试在Format
函数中使用区域性。在服务器上运行此查询时,结果不正确:
SELECT @@VERSION --> Microsoft SQL Server 2017 (RTM-CU17) (KB4515579) - 14.0.3238.1 (X64) Sep 13 2019 15:49:57 Copyright (C) 2017 Microsoft Corporation Enterprise Edition (64-bit) on Windows Server 2012 R2 Standard 6.3 <X64
SELECT FORMAT(SYSDATETIME(), N'Y', 'fa'); --> February 2020
但是在带有SQL Server 2017的另一台服务器中运行此脚本时,脚本运行良好:
SELECT @@VERSION --> Microsoft SQL Server 2017 (RTM-CU3-GDR) (KB4052987) - 14.0.3015.40 (X64) Dec 22 2017 16:13:22 Copyright (C) 2017 Microsoft Corporation Enterprise Edition (64-bit) on Windows 10 Enterprise 10.0 <X64> (Build 16299: )
SELECT FORMAT(SYSDATETIME(), N'Y', 'fa'); --> بهمن, 1398
必须检查哪些配置?
P.S:我意识到此问题出现在Windows Server 2012 R2
及更低版本上。