Forum Replies Created

Viewing 15 posts - 4,066 through 4,080 (of 6,036 total)

  • RE: Round to Even (aka Banker''''s Rounding) - The final function

    Whole bunch of examples where FLOAT (DOUBLE PRECISION) fails is in 1st topic.

    Regarding second one:

    DECLARE

    @enumerator DECIMAL(38, 12)

    ,@denominator DECIMAL(38, 12)

    SELECT

    @enumerator = 50

    ,@denominator = 111.111

    SELECT @enumerator/@denominator,

    ...

  • RE: Bankers Rounding

    JacekO, did you notice my post clarifiyng what was wrong with initial version of the function?

    Post after which everything became clear?

    Yes, I fixed the function, but I cannot fix...

  • RE: Bankers Rounding

    David, nobody can stop you from wasting your time on implementation.

    Just take this for testing:

    DECLARE

    @enumerator DECIMAL(35, 25)

    ,@denominator DECIMAL(35, 25)

    SELECT

    @enumerator = 5

    ,@denominator = 111.111

    SELECT @enumerator/@denominator,

    dbo.fn_BRound(@enumerator/@denominator,...

  • RE: Bankers Rounding

    David,

    the only person who demonstrates stupidity is you (not only, actually, but not me ).

    I passed to BR 2 representations of the same value...

  • RE: SQL Query Question

    According to the definition of table #tmp it's

    table_name, column_name, num_records

    where you've got value '20202'.

  • RE: Bankers Rounding

    BTW, I'm thrilled to see the implementation of BR which will round 100000000.01/800000000.01 correctly.

  • RE: Bankers Rounding

    Where?

    I saw truncated value .66666666, not 2/3.

    Can you pass 2/3 = 0.(6) into that function?

  • RE: SQL Query Question

    Just open tables sysobjects and syscolumns and change the names in the query correspondingly.

    id, xtype, etc.

  • RE: Bankers Rounding

    So, I asked you to pass 2/3 to that function.

    Can you do it?

  • RE: Bankers Rounding

    David, BR does not take into account next digits.

    It assumes that all digits following those you can see (depending on precision you've got) are zeros.

    Which is an impossible event.

    That's...

  • RE: Bankers Rounding

    DECLARE

    @enumerator decimal(23,15)

    ,@denominator decimal(23,15)

    SELECT

    @enumerator = 2

    ,@denominator = 3

    SELECT @enumerator/@denominator,

    dbo.fn_BRound(@enumerator/@denominator, 100)

    ,Round(@enumerator/@denominator,2)

    ---------------------------------------- --------------------- ----------------------------------------

    .666666666666666 ...

  • RE: SQL Query Question

    sys.objects and sys.columns are from system catalog in SQL2005.

    For SQL2000 use sysobjects and syscolumns.

  • RE: SQL Query Question

    I don't think you read that post attentively enough.

    That script searches for a value in all columns of all user tables.

  • RE: Error when logging in with user other than ''''SA''''

    > The stored procedure is there and public has execute permission.

    The stored procedure is where?

    There is a sp "sp_helpUser" in master database. And SQL Server will always try to execute...

Viewing 15 posts - 4,066 through 4,080 (of 6,036 total)