Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

sql - DATENAME(MONTH,GETADATE()) is returning numeric value of the month as '09'

When I run the following query [SELECT DATENAME(MONTH,GETDATE())], ideally speaking it should return value as 'September' but its returning value as '09'. I am running this query on MS SQL Server 2005. Is there anything I need to configure with MS SQL Server 2005?

Please find the details of the SQL Server 2005

Component Name                                Version
--------------------------------------------------------------------
Microsoft SQL Server Management Studio        9.00.1399.00
Microsoft Analysis Services Client Tools      2005.090.1399.00
Microsoft Data Access Components (MDAC)       2000.086.3959.00 (srv03_sp2_rtm.070216-1710)
Microsoft MSXML                               2.6 3.0 4.0 5.0 6.0 
Microsoft Internet Explorer                   6.0.3790.3959
Microsoft .NET Framework                      2.0.50727.42
Operating System                              5.2.3790
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
SELECT @@LANGUAGE -> gives an Asian one?

SET LANGUAGE Japanese
SELECT DATENAME (month, GETDATE())

SET LANGUAGE us_english
SELECT DATENAME (month, GETDATE())

DATENAME depends on language, so need to change server default or your login default language...

Thank you and sayonara...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...