drop table TestTable
create table TestTable(
[role_id] int null,
[resource_id] int null,
[SomeDate] datetime null
)
insert into TestTable(
[role_id],
[resource_id],
[SomeDate])
values
(5, null, convert(datetime, '2018-03-10T05:17:00.05'))
-- could insert through some kind of implicit conversion!
insert into TestTable(
[role_id],
[resource_id],
[SomeDate])
values
(5, null, '2018-04-13T05:17:00.05')
-- includes milliseconds
declare @somevar datetime = convert(datetime, '2018-03-10T05:17:00.05')
declare @notherDateTime datetime = '2018-03-10T05:17:00.05'
-- this does not work! need to replace slashes
-- declare @somevar datetime = convert(datetime, '2018/03/10T05:17:00.05')
-- [Format SQL Server Dates with FORMAT Function](https://www.mssqltips.com/sqlservertip/2655/format-sql-server-dates-with-format-function/)
select format(getdate(), 'MMMM/yy')