Viewing 15 posts - 27,451 through 27,465 (of 59,101 total)
Kevin.roberts25 (2/19/2013)
Create Procedure sp_EmployeeSelect_Coalesce
@EmployeeName NVarchar(100),
...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2013 at 5:25 pm
bquintana (2/19/2013)
DECLARE@strColumns VARCHAR(MAX)
DECLARE@strSQL VARCHAR(MAX)
IF OBJECT_ID('tempdb..#tmp_table') IS NOT NULL
DROP TABLE #tmp_table
CREATE TABLE #tmp_table
(
CallDateTimeDATETIME,
HistIDINT
)
INSERT #tmp_table( CallDateTime, HistID )
Select'11/1/2012 9:02:30.000',2270647UNION ALL
Select'11/1/2012 8:59:59.000',2270648UNION ALL
Select'11/1/2012 9:01:33.000',2270650UNION ALL
Select'11/1/2012 9:03:40.000',2270652UNION ALL
Select'11/1/2012 9:02:50.000',2270653UNION...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2013 at 4:49 pm
drew.allen (2/19/2013)
Jeff Moden (2/15/2013)
OTF (2/15/2013)
You can also take a look at using OUTPUT.
I've found that to be a wee bit more difficult than you would think unless you have an...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2013 at 4:13 pm
Ah. Understood. It would be interesting to find out which is actually faster, though. The mTVF with a loop or the iTVF with the recursive CTE.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2013 at 9:26 am
Got it. Thanks for the clarification, Nadrek.
It would, however, be interesting to see how someone might reverse engineer things to be able to pick the next random number without it...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2013 at 9:22 am
ScottPletcher (2/18/2013)
Jeff Moden (2/18/2013)
ScottPletcher (2/18/2013)
declare @enddate datetime
set @enddate = getdate()
SELECT STUFF(CONVERT(varchar(10), DATEADD(DAY, -21, @enddate), 1), 3, 4, '')
Except for Sean, we did forget to answer the original question. :blush: ...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 19, 2013 at 9:20 am
Gabriel P (2/18/2013)
Ian C0ckcroft (2/18/2013)
i can do...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 5:16 pm
Lynn Pettis (2/18/2013)
Eric M Russell (2/18/2013)
Lynn Pettis (2/18/2013)
Eric M Russell (2/18/2013)
However, SET DATEFORMAT setting influences how...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 4:54 pm
free_mascot (2/14/2013)
Check this out:
I think that Brent's descriptions are probably the easiest to understand. DBAs that have a foot in each camp are frequently referred to as "Hybrid DBAs"...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 4:47 pm
bquintana (2/18/2013)
Table dbo.HisT contained info in this format
CallDateTime ...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 4:28 pm
ScottPletcher (2/18/2013)
declare @enddate datetime
set @enddate = getdate()
SELECT STUFF(CONVERT(varchar(10), DATEADD(DAY, -21, @enddate), 1), 3, 4, '')
Except for Sean, we did forget to answer the original question. :blush: Thanks, Scott.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 4:23 pm
_simon_ (2/18/2013)
I'm pretty sure my c# method is ok (code taken from here: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx), so I just deployed it to Sql:
[SqlFunction]
public static int RndBetween(int minValue, int maxValue)
{
if...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 12:43 pm
Kingston Dhasian (2/18/2013)
Jeff Moden (2/15/2013)
I suppose consistency is a good reason. But, let's try something just for fun. Write some code to add 41:41:41.041 to a given date.
My...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 12:39 pm
dwain.c (2/17/2013)
You can also do this with a recursive CTE, which can be put into an iTVF.See the first example, in the third article in my signature links.
Yes, you could....
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 12:32 pm
ahpitre (2/18/2013)
1) If the string to be splitted has the delimiter character at the end,...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2013 at 12:18 pm
Viewing 15 posts - 27,451 through 27,465 (of 59,101 total)