Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql user default language problem

Status
Not open for further replies.

baran121

Programmer
Sep 8, 2005
337
0
0
TR
Hi Everybody,
i have installed SQL server 2016 standart edition running on Windows 2019.
I create an user i tried to use Default language as English. but each time i set it English then when i want to look back language goes back to Arabic.

my main problem when i use
print getdate()
i have 12 Hours with AM-PM, but i want to use 24 Hours timing.

can you help me please,I got crazy,and couldnt understand what is problem.
Thank you.

 
What are you doing to set the default language for the users?


-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
what you mean gmmastros about doing. sorry i didnt understand.
i just wanted to use dateformat dd.mm.yyyy and time format hh:mm (24 hours)
and i wanted to understand why i couldnt change any user's language from arabic in security part.
thanks.
 
Date formats can be confusing. If you simply select a date and/or time, you will see SQL Server's representation of it, which is yyyy-mm-dd hh:mm:ss.nnn

A login's default language only applies to converting to date.

Ex:

Code:
-- This will use the login's dateformat for their default language
Select Convert(DateTime, '09.10.2019')

-- you can override the default language like this.
set language German
Select Convert(DateTime, '09.10.2019')
set language us_english
Select Convert(DateTime, '09.10.2019')

Note that for German, a date in October is returned, but for US English, the date is in September.

When converting FROM datetime to string, you can use the convert function with the optional 3rd parameter for style, like this:

Code:
Select Convert(VarChar(20), GetDate(), 104)
Select Convert(VarChar(20), GetDate(), 108)



-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Hi gmmastros,
Thank you for your reply.
I have tried (set language) . But still i have problem.
I susspect Windows server date and time format . Even i change region format with dd.mm.yyyy in my code it gives me in mm.dd.yyyy format.
please help me, thank you.

 
Handle how date/datetime will be displayed are job for your frontend.


Borislav Borissov
VFP9 SP2, SQL Server
 
Can you show some code that you are having a problem with?

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top