Viewing 15 posts - 3,481 through 3,495 (of 4,087 total)
Duplicate post. Please post responses here: http://www.sqlservercentral.com/Forums/Topic1207598-392-1.aspx
Please don't cross-post. It fragments the discussion.
Drew
November 17, 2011 at 9:07 am
terryshamir (11/17/2011)
November 17, 2011 at 8:18 am
Cadavre (11/17/2011)
PRINT '========== Alternative=========='
SELECT @Holder = randomDate + randomTime
FROM #testEnvironment
PRINT '========== Alternative 2=========='
SELECT @Holder = DATEADD(SECOND, DATEDIFF(SECOND, 0, randomTime), randomDate)
FROM #testEnvironment
PRINT '========== Alternative 3=========='
SELECT @Holder = DATEADD(d, DATEDIFF(d, randomTime, randomDate),...
November 17, 2011 at 8:10 am
You're probably better off leaving the pivot to your reporting software. You don't provide enough details to say for sure.
Drew
November 17, 2011 at 7:49 am
It has been repeatedly shown that manipulating dates by converting back and forth between character data performs very poorly versus using the datetime functions. The following code will always...
November 17, 2011 at 7:33 am
The .value() function requires a singleton, and you may not have specified the singleton correctly.
Drew
November 17, 2011 at 6:57 am
ahmed_b72 (11/16/2011)
Is there a way to avoid displaying every row returned from the cursor?
The best way is to avoid using a cursor in the first place. They perform horribly...
November 17, 2011 at 6:49 am
CELKO (11/16/2011)
November 16, 2011 at 3:12 pm
You're most of the way there. This should give you what you want. The vast majority of the time, you'll probably want to use relative paths for everything...
November 16, 2011 at 2:47 pm
Your data doesn't have enough information to fully specify the order, so the order is not completely guaranteed. For example 17 could easily render as "Riding on big horses...
November 16, 2011 at 1:17 pm
MattieNH (11/16/2011)
I have a table of valid suffixes that I want to loop through (yes, a cursor).
You really don't. There is nothing in your query that indicates that a...
November 16, 2011 at 11:54 am
John Mitchell-245523 (11/16/2011)
That UPDATE statement won't loop through the rows in @Dept - it will use the first row in @Depts that it finds and then stop.
Actually, as Jeff Moden...
November 16, 2011 at 8:46 am
A good rule of thumb to use is that you should not use code that you find on the Internet unless you understand what it is doing. If a...
November 15, 2011 at 3:14 pm
Lowell (11/15/2011)
your example is bending an IF into a situation similar to a CASE, but an IF statement can do much more than that.
I would argue that he's doing the...
November 15, 2011 at 1:27 pm
It's because your '<B>' is text, not xml. The easiest way is to use the following:
select
= convert(varchar(3), t.num),'',
...
November 15, 2011 at 9:40 am
Viewing 15 posts - 3,481 through 3,495 (of 4,087 total)