Weblog @ rebex.cz

Weblogy na webu Rebexu
Welcome to Weblog @ rebex.cz Sign in | Help
in Search

Weblog @ Rebex.cz :: Honza Šotola

nepravidelné poznámky .NET vývojáře

SQL Server datetime formát – má víra byla scestná

Dlouhá léta jsem věřil, že pro textový zápis data (nebo data a času) je nejjistější používat ANSI SQL formát:
‘yyyy-mm-dd’ (nebo ‘yyyy-mm-dd hh:mi:ss’).
Není tomu tak – tento formát je poplatný jazykovému nastavení aktuální SQL connection.



Žil jsem tedy přes 10 let v bludu. Kajícně jsem si v článku v Books Online dohledal, že jazykově nezávislé formáty data v SQL Serveru jsou například:

  • yyyymmdd’ nebo ‘yyyymmdd hh:mi:ss
    ISO 8601 un-separated
  • ‘yyyy-mm-ddThh:mi:ss’
    ISO 8601 datetime
    (podle Books Online není jazykově nezávislý, ale podle mých pokusů i jiných zdrojů je nezávislý)
  • {d’yyyymmdd’} nebo {ts’yyyymmdd' hh:mi:ss’}
    ODBC formáty

POZN: Nové datové typy SQL Serveru 2008 jsou více jazykově neutrální – pro datový typ Date, DateTime2 nebo DateTimeOffset je jazykově neutrální i můj původně profanovaný formát ‘yyyy-mm-dd’ (nebo ‘yyyy-mm-dd hh:mi:ss’).



Další informace jsou moc hezky sepsané a shrnuté v následujícím článku:
http://www.karaszi.com/SQLServer/info_datetime.asp (zejména v kapitole “Date and time formats for input”).

Published 23. května 2011 13:28 by honzas
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



Rehkop said:

Go tto the market, seearch for Sipp - Droid, and download and install

it. However it can generate additional site stats like screen resolution or visitor identifiers from tthe same log

files if you incluxe a small java script into your pages. Finally,

both of these phones are noted for their speed and lack of

lag when utilzing apps and navigating within their respective interfaces.


června 19, 2014 13:23

Duppstadt said:

This site was... how do I say it? Relevant!! Finally I have found something that helped me.

Appreciate it!

června 28, 2014 6:57

Trouton said:

Their customer service goes above and beyond in

order to help you get your money. He uses every drawn line to his advantage and breathes life into the words pouring forth from Snyder, Tynion IV, and company.

There are buyers out there that have to have swiftly entry to

richesse but they can't get any richesse just as a result of there are so handful of choices readily available.

července 4, 2014 2:41

Pendley said:

I'm not sure why buut this web site is loading extremely slow for me.

Is anyone else having this problem or is it a issue on my end?

I'll check back later and see iif the problem still exists.

září 6, 2014 10:59

Stefan said:

Ahoj Viem, že je to mimo tému, ale ja som sa opýtať, či ste

vedel o všetkých widgetov som mohol pridať na môj blog,

ktorý automaticky Tweet My najnovšie twitter aktualizácie.

Hľadal som naa plug-in takhle nejakú dobu, a dúfal, že možno budete

mať nejaké skúsenosti s niečím, ako je toto.

Prosím, dajte mi vedieť, ak sa dostanete do ničoho.

Naozj som si čítať váš blog a teším sa na vaše nové aktualizácie.

října 22, 2014 0:56

Bennett said:

bookmarked, fantastic website!

února 2, 2015 9:31

Owen said:

This excellent website truly has all the information and facts I needed

concerning this subject and didn't know who to ask.

května 1, 2015 5:16

market research naics said:

I loved as much as you'll receive carried out right

here. The sketch is tasteful, your authored subject matter stylish.

nonetheless, you command get bought an shakiness over that you wish

be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly very often inside case you shield this increase.

listopadu 1, 2016 3:27

Hot Sxeseis said:

It's neaqrly impossible tto find educated people in this particular topic, however,

you seem like you know what you're talking about!


března 27, 2017 16:29

lottery ks said:

The odds of matching 4 of 5 winning numbers are 1 in 2,432 and the odds of matching 3 of 5

winning numbers are 1 in 81. Make plans to reach your financial mountain top and get out of the valley of want

and need. Article Source:  Davis is a Expert on Online Lotteries and a marketing executive at Triumph Marketing, you can find more of Jeff's lottery articles and buy real lottery tickets at.

Many individuals through the net state to possess

particular tried and examined approaches to help you you select profitable amounts but beware of them as most of those could possibly just be scams.

dubna 21, 2017 0:48

Www.Bcs-Urec.ru said:

These are genuinely impressive ideas in concerning blogging.

You have touched somne pleasant points here. Any way keep upp wrinting.

července 29, 2017 7:42

gifts said:

Hey I know thiss is off topic butt I was wondering if you knew of

any widdgets I could add to my bblog that automatically tweeet myy newest twitter updates.

I've been looking for a plug-in like this for quite some time and was hoping

maybe you would have some experience wwith something like this.

Please let mme know if you run into anything. I truly enjoy reading your blog

and I loook forward to your new updates.

října 30, 2017 2:21

Old free Movies said:

Amazing issues here. I am very satisfied to peer your post.

Thank you a lot and I'm having a look forward

to contact you. Will you please drop me a mail?

května 30, 2018 0:31

transparent lace dress said:

Caitlyn previously revealed on Keeping Up With the Kardashians she is going to likely

get surgical procedure to take away her penis and substitute it with a surgical vagina sometime down the line.

For now, the previous Bruce Jenner needs to shine a highlight on the

transgender neighborhood, which she says has been misunderstood for too lengthy.

srpna 25, 2018 2:02

http://p0lvekz6su.lompp.ru said:

října 30, 2018 17:04

Leave a Comment

Powered by Community Server (Personal Edition), by Telligent Systems