1 Declare @i int=12 begin3 while(@i<= $)4 begin5 BEGINTry6 Print Convert(varchar(3),@i)+' '+Convert(VARCHAR,getdate(),@i)7 ENDTRY8 BEGINCatch9 EndCatchTen Set @i=@i+1 One End A End
Results:
1:11/30/14
2:14.11.30
3:30/11/14
4:30.11.14
5:30-11-14
6:30 11 14
7:11 30, 14
8:21:18:44
9:11 9:18:44:983pm
10:11-30-14
11:14/11/30
12:141,130
13:30 11 2014 21:18:44:983
14:21:18:44:983
20:2014-11-30 21:18:44
21:2014-11-30 21:18:44.983
22:11/30/14 9:18:44 PM
23:2014-11-30
24:21:18:44
25:2014-11-30 21:18:44.983
100:11 9:18pm
101:11/30/2014
102:2014.11.30
103:30/11/2014
104:30.11.2014
105:30-11-2014
106:30 11 2014
107:11 30, 2014
108:21:18:44
109:11 9:18:44:983pm
110:11-30-2014
111:2014/11/30
112:20,141,130
113:30 11 2014 21:18:44:983
114:21:18:44:983
120:2014-11-30 21:18:44
121:2014-11-30 21:18:44.983
126:2014-11-30t21:18:44.983
127:2014-11-30t21:18:45.030
130:8??? 1436 9:18:45:030pm
131:8/02/1436 9:18:45:030pm
SQL Server time formatting