[dba-SQLServer]Connection String

Wortz, Charles CWortz at tea.state.tx.us
Fri Apr 4 07:30:14 CST 2003


David,

Sorry, but I must correct you.  Integer arithmetic ALWAYS truncates!  It
has been so since the first binary computer.  To round you must, repeat
MUST, use floating-point numbers.

Charles Wortz
Software Development Division
Texas Education Agency
1701 N. Congress Ave
Austin, TX 78701-1494
512-463-9493
CWortz at tea.state.tx.us



-----Original Message-----
From: David Emerson [mailto:davide at dalyn.co.nz] 
Sent: Thursday 2003 Apr 03 18:14
To: dba-sqlserver at databaseadvisors.com
Subject: Re: [dba-SQLServer]Connection String


Thanks Francisco.

Another thing I found out today was that if you divide an integer by an 
integer SQL will round the result to an integer.  Using the ROUND() 
function doesn't help if you want decimal places.  My solution was to
CAST 
one of the number as a float.  Another of Microsoft's features?

David


More information about the dba-SQLServer mailing list