SQL Server Datetime issues. American vs. British? -


On my test db, the dates are displayed in the DD / MM / YYYY format. On display, I mean that when you right click, the table open in Management Studio, the returned data is displayed in the DD / MM / YYYY format.

The funny thing is that when I write T-SQL, I have to input an MM / DD / YYYY format to get the right data back. Can I align it in the DD / MM / Y Wiai format anyway?

You can use the date format in the SQL Server in the expected format (I think the management studio uses the computer's regional settings for the purposes of the computer, though not sure). However, I believe that they consider the values ​​using parameters rather than embedding in the Queryment statement. If you use the criteria you will not face any issues. Everything is taken care of.

  set language us_english declare @d datetime = '1929/12/18' set language British declared @d datetime = '1929/12/18' - failed  
  declare @ langid int = (choose from syslanguages ​​langid where name = 'british') exec sp_configure 'default language', override  < Reconfigure langad with / pre> 

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -