Tuesday, 19 November 2019

Get List of Date Format options in SQL Server


SELECT DISTINCT dateformat FROM sys.syslanguages;

dateformat
dmy
mdy
ymd



Change Language option in SQL Server


SET LANGUAGE 'us_english'
Changed language setting to us_english.

NOTE: It applies only the current session/connection.

For verifying the settings, execute the following SQL Command
DBCC useroptions;



Get List of Language options in SQL Server


SELECT langid, name FROM sys.syslanguages;

langid
name
0
us_english
1
Deutsch
2
Français
3
日本語
4
Dansk
5
Español
6
Italiano
7
Nederlands
8
Norsk
9
Português
10
Suomi
11
Svenska
12
čeština
13
magyar
14
polski
15
română
16
hrvatski
17
slovenčina
18
slovenski
19
ελληνικά
20
български
21
русский
22
Türkçe
23
British
24
eesti
25
latviešu
26
lietuvių
27
Português (Brasil)
28
繁體中文
29
한국어
30
简体中
31
Arabic
32
ไทย
33
norsk (bokmål)





Get SQL Database Current Settings/Options

DBCC useroptions;

Set Option
Value
textsize
2147483647
language
us_english
dateformat
mdy
datefirst
7
lock_timeout
-1
quoted_identifier
SET
arithabort
SET
ansi_null_dflt_on
SET
ansi_warnings
SET
ansi_padding
SET
ansi_nulls
SET
concat_null_yields_null
SET
isolation level
read committed

Get TimeZone Name of the System in SQL Server


DECLARE @TimeZone VARCHAR(50)

EXEC MASTER.dbo.xp_regread 'HKEY_LOCAL_MACHINE',
       'SYSTEM\CurrentControlSet\Control\TimeZoneInformation',
       'TimeZoneKeyName', @TimeZone OUT

SELECT @TimeZone AS TimeZone