Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

In QotD, posted on Aug 6 on ROWCOUNT and table variable Expand / Collapse
Posted Friday, August 27, 2010 3:45 AM


Group: General Forum Members
Last Login: Wednesday, August 26, 2015 3:27 PM
Points: 169, Visits: 325
Pls help me on this. In QotD, question posted on Aug 6 on ROWCOUNT, the answer in infinite loop. ie, the condition @i <> 1 always is true . But another sample query as shown below gives expected result which contradicts from while loop.

DECLARE @i float
set @i = .9
set @i = @i + .1

-- Query 1
if @i <> 1
print 'Yes'
print 'No'

Answer: No

-- Query 2
if @i = 1
print 'Yes'
print 'No'

Answer: Yes

Can anyone pls explain on difference in this two.
Post #976247
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse