Viewing 4 posts - 1 through 4 (of 4 total)
Good article.
Listing 7 is an incorrect script. It is a repeat of Script 6.
October 10, 2012 at 12:36 am
My biggest peeve with SQL developers who publish articles (in general, not just this author) is the laziness shown by not matching the case of all object names.
Please take the...
October 2, 2012 at 1:28 am
An Alternative:
ALTER FUNCTION [dbo].[GetDateTimeString]
(
@inDateTime datetime
)
RETURNS varchar(12)
AS
BEGIN
DECLARE @DateString varchar(12), @Hours varchar(2), @Minutes varchar(2)
SELECT@Hours = CONVERT(varchar(2), DATEPART(hour, @inDateTime)),
@Minutes = CONVERT(varchar(2), DATEPART(minute, @inDateTime)),
@DateString = CONVERT(varchar(8), @inDateTime, 112) +
STUFF('00', 3 - LEN(@Hours),...
July 31, 2009 at 4:47 am
I would construct a function like this for the same purpose.
Not so easy to read but I think it is probably a little more efficient.
/*
DECLARE @dtest NVARCHAR(14)
SET
July 31, 2009 at 4:29 am
Viewing 4 posts - 1 through 4 (of 4 total)