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
,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'




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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s