Undocumented Date and Time Styles


 

  

 ;with mycte as (
SELECT Try_convert( varchar(30), getdate(),[number]) datetimeOutput, number as style,
len( Try_convert( varchar(30) , getdate(),[number]) ) len_datetimeOutput
,Case when number in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,20,21
,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,120,121
,126,127,130,131) Then 'Yes' Else 'No' End documentedStyle FROM [master].[dbo].[spt_values]
Where type='P' and Number<128+4

)

Select datetimeOutput, style,len_datetimeOutput,documentedStyle from mycte
Where datetimeOutput is not null and documentedStyle='No'

 

https://msdn.microsoft.com/en-us/library/ms187928%28SQL.105%29.aspx?f=255&MSPPError=-2147217396
 

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s