Viewing 15 posts - 751 through 765 (of 819 total)
If one omits the set nocount on statement, then the results would be 1,1.
This assert is wrong.
The correct answer is 0,1, but the two statement should be the first in...
January 29, 2010 at 3:16 am
Volumes of data returned from tables may vary (test or production database), so a well performing query may slow down or give an error.
FROM BOL:
Including an extremely large number...
January 27, 2010 at 1:41 am
My answer is correct, but it's luck!
The text of the question is incomprehensible and the explanation is more and more incomprehensible.
December 29, 2009 at 12:54 am
If the SELECT statement returns no rows, the variable retains its present value. If expression is a scalar subquery that returns no value, the variable is set to NULL.
That...
December 14, 2009 at 1:17 am
The question is:
it is a BUG?
... or it is by design?
... or both: it is a BUG by design!
Try this:
DECLARE @v-2 char(10)
SET CONCAT_NULL_YIELDS_NULL ON
SELECT ISNULL('abcd'+@v,'1234567890')
RESULT: 1234567890
This behavior is all right!
December 11, 2009 at 8:34 am
Also a void string take 1 CHAR:
SET CONCAT_NULL_YIELDS_NULL ON
SELECT ISNULL('abcd'+''+null,'1234567890')
Result: 123456
December 11, 2009 at 6:19 am
vk-kirov, I agree with you. Question and answer is incomprehensible!!!!
December 9, 2009 at 1:14 am
rcavill (12/7/2009)
You need the optionMust declare the scalar variable "@Dec".
When running on a Case Sensitive collation.
Once that select statement on line 2 is adjusted then it would work.
------
Robert
Have good luck...
December 7, 2009 at 3:28 am
Explanation is in the note.
Try to reduce the precision.
SELECT CAST(cast(1.67574 as decimal(38,10)) / cast(10000 as decimal(38,10)) AS DECIMAL(38,10) ) conv_factor
returns 0.0001670000
SELECT CAST(cast(1.67574 as decimal(29,10)) / cast(10000 as decimal(29,10)) AS...
December 4, 2009 at 7:34 am
SQLBOT (11/29/2009)
Comments posted to this topic are about the item <A HREF="/questions/Datetime+Manipulation/68075/">Datetime precision</A>
Thanks. After year and years working with sql, there always is something to learn.
November 30, 2009 at 6:34 am
Rob Goddard (11/27/2009)
does the optimizer spot this and skip all the variable assignments and just do the last one?
All the variable assignments are done.
November 27, 2009 at 7:00 am
Wouldn't you always get a row returned with the COUNT(*) aggregate? It might return 0 as the result but that still returns a row.
That's true!
November 25, 2009 at 6:38 am
WARN: If you use an aggregate function @a will be updated also if no row is returned
[font="Arial"]SET NOCOUNT ON
declare @vals table (iKey int, iValue int)
insert into @vals (iKey, iValue)
select...
November 25, 2009 at 6:24 am
Viewing 15 posts - 751 through 765 (of 819 total)