How to change the language and date format in SQL

2019-02-03 12:40发布

I am using SQL Server 2005. When I execute DBCC USEROPTIONS, I see the language as romana and dateformat as dmy.

I want the language to be us_english and dateformat as mdy.

How can I do this? I was having these settings initially but somehow they got changed to romana.

How to revert back to us_english and date as dmy?

2条回答
狗以群分
2楼-- · 2019-02-03 12:56

You can reset the language by using the below syntax

set language 'us_english'

In order to view all the languages and their date format try this one

select * from sys.syslanguages

If you need to permanently change the language then

  • Go To Security
  • Logins
  • Right Click on your username and select Properties
  • Change the default language to English

This change will persist even after you restart your SSMS

查看更多
贪生不怕死
3楼-- · 2019-02-03 13:04

Before

DBCC USEROPTIONS

is returning something like this:

Current user options


To change your or UserLogin configuration run:

USE [master]
GO

ALTER LOGIN [UserLogin] WITH DEFAULT_LANGUAGE=[us_english]
GO

Next - reconnect to SQL (logout -> login).

After

You will get this:

Current user options

查看更多
登录 后发表回答