DECLARE @tmpDate TABLE
(
[Formart Expression] NVARCHAR(10),
[Converted Date] NVARCHAR(100)
)
DECLARE @i INT
DECLARE @style NVARCHAR(10)
SET @i = 1
WHILE @i <= 50
BEGIN
SET @style = CONVERT(INT, '100') + CONVERT(INT, @i)
BEGIN try
INSERT INTO @tmpDate ([Formart Expression] , [Converted Date])
SELECT @style, CONVERT(NVARCHAR(100), GETDATE(), CONVERT(INT, @style))
END TRY
BEGIN CATCH
END CATCH
SET @i = @i + 1
END
SELECT * FROM @tmpDate
(
[Formart Expression] NVARCHAR(10),
[Converted Date] NVARCHAR(100)
)
DECLARE @i INT
DECLARE @style NVARCHAR(10)
SET @i = 1
WHILE @i <= 50
BEGIN
SET @style = CONVERT(INT, '100') + CONVERT(INT, @i)
BEGIN try
INSERT INTO @tmpDate ([Formart Expression] , [Converted Date])
SELECT @style, CONVERT(NVARCHAR(100), GETDATE(), CONVERT(INT, @style))
END TRY
BEGIN CATCH
END CATCH
SET @i = @i + 1
END
SELECT * FROM @tmpDate
10:59 PM |
Category: |
1 comments
Comments (1)
Diffrent date format while converting from datetime to string