-- 转义的SQL --
select
t.ID, t.TheName, t.ClassId,
t.CreateTime, t.UpdateTime
from UTB_EXAM_STUDENT t
where t.CreateTime = convert(datetime,'2017-01-01 00:00:00',20)
@tp1 = convert(datetime,'2017-01-01 00:00:00',20)
-- 原始执行的SQL --
select
t.ID, t.TheName, t.ClassId,
t.CreateTime, t.UpdateTime
from UTB_EXAM_STUDENT t
where t.CreateTime = @tp1
@tp1 2017-01-01 00:00:00 DateTime Input SqlParameter