T-SQL将datetime类型转换为字符型
select convert(char(8),getdate(),112)
20030319
select convert(char(10),getdate(),120)
2003-03-19
select convert(char(19),getdate(),120)
2003-03-20 10:34:00
select convert(char(8),getdate(),114)
10:34:29
20030319
select convert(char(10),getdate(),120)
2003-03-19
select convert(char(19),getdate(),120)
2003-03-20 10:34:00
select convert(char(8),getdate(),114)
10:34:29