×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

sql user default language problem

sql user default language problem

sql user default language problem

(OP)
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.

RE: sql user default language problem

These questions might be better asked in the Microsoft SQL Server: Setup and Administration forum.

https://www.tek-tips.com/threadminder.cfm?pid=962

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


RE: sql user default language problem

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

RE: sql user default language problem

(OP)
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.

RE: sql user default language problem

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

RE: sql user default language problem

(OP)
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.

RE: sql user default language problem

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


Borislav Borissov
VFP9 SP2, SQL Server

RE: sql user default language problem

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close