Showing posts with label negative. Show all posts
Showing posts with label negative. Show all posts

Friday, March 30, 2012

rowmodctr

why rowmodctr in sysindexes table shows negative values instead of zero after
a index rebuild in sql 2000 ?
Thanks,
Ranga
Ranga,
The value of [rowmodctr] is increased just for index ID 0 or 1. For the
rest of indexes and statistics, it shows a relative value that has to be
added to the [rowmodctr] of the index 0 or 1 to get the true number of
changed rows for this index.
Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
AMB
"Ranga" wrote:

> why rowmodctr in sysindexes table shows negative values instead of zero after
> a index rebuild in sql 2000 ?
> Thanks,
> Ranga
|||Thanks...
I have two tables each has several non clustered indexes...for one of them
I see negative values in the rowmodctr, for the other table i see zero for
rowmodctr...though it is not causing any problems, just curious to know what
is behind this.
I did reindex first, and the value got set to zero, a nightly update
statistics job changed the zero value to a negative number ? Is this what
happenned ?
Ranga
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Ranga,
> The value of [rowmodctr] is increased just for index ID 0 or 1. For the
> rest of indexes and statistics, it shows a relative value that has to be
> added to the [rowmodctr] of the index 0 or 1 to get the true number of
> changed rows for this index.
> Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
> http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
>
> AMB
> "Ranga" wrote:

rowmodctr

why rowmodctr in sysindexes table shows negative values instead of zero afte
r
a index rebuild in sql 2000 ?
Thanks,
RangaRanga,
The value of [rowmodctr] is increased just for index ID 0 or 1. For the
rest of indexes and statistics, it shows a relative value that has to be
added to the [rowmodctr] of the index 0 or 1 to get the true number of
changed rows for this index.
Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
AMB
"Ranga" wrote:

> why rowmodctr in sysindexes table shows negative values instead of zero af
ter
> a index rebuild in sql 2000 ?
> Thanks,
> Ranga|||Thanks...
I have two tables each has several non clustered indexes...for one of them
I see negative values in the rowmodctr, for the other table i see zero for
rowmodctr...though it is not causing any problems, just curious to know wha
t
is behind this.
I did reindex first, and the value got set to zero, a nightly update
statistics job changed the zero value to a negative number ? Is this what
happenned ?
Ranga
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Ranga,
> The value of [rowmodctr] is increased just for index ID 0 or 1. For t
he
> rest of indexes and statistics, it shows a relative value that has to be
> added to the [rowmodctr] of the index 0 or 1 to get the true number of
> changed rows for this index.
> Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
> http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
>
> AMB
> "Ranga" wrote:
>sql

rowmodctr

why rowmodctr in sysindexes table shows negative values instead of zero after
a index rebuild in sql 2000 ?
Thanks,
RangaRanga,
The value of [rowmodctr] is increased just for index ID 0 or 1. For the
rest of indexes and statistics, it shows a relative value that has to be
added to the [rowmodctr] of the index 0 or 1 to get the true number of
changed rows for this index.
Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
AMB
"Ranga" wrote:
> why rowmodctr in sysindexes table shows negative values instead of zero after
> a index rebuild in sql 2000 ?
> Thanks,
> Ranga|||Thanks...
I have two tables each has several non clustered indexes...for one of them
I see negative values in the rowmodctr, for the other table i see zero for
rowmodctr...though it is not causing any problems, just curious to know what
is behind this.
I did reindex first, and the value got set to zero, a nightly update
statistics job changed the zero value to a negative number ? Is this what
happenned ?
Ranga
"Alejandro Mesa" wrote:
> Ranga,
> The value of [rowmodctr] is increased just for index ID 0 or 1. For the
> rest of indexes and statistics, it shows a relative value that has to be
> added to the [rowmodctr] of the index 0 or 1 to get the true number of
> changed rows for this index.
> Statistics Used by the Query Optimizer in Microsoft SQL Server 2000
> http://msdn2.microsoft.com/en-us/library/aa902688(SQL.80).aspx
>
> AMB
> "Ranga" wrote:
> > why rowmodctr in sysindexes table shows negative values instead of zero after
> > a index rebuild in sql 2000 ?
> >
> > Thanks,
> > Ranga

Wednesday, March 7, 2012

Rounding very small negative numbers to string

Hi,
I'm trying to round a very small negative number, e.g. -.024, to a string.
If I round -.024 to 1 place, I get 0.0
However, when converting to string, I get .-0
Is there some combination of functions to get rid of the minus sign in such
a situation, or do I have to put in an IF condition to check if number < .05
and change it to ABS?
Below is code that is resulting in -0.
Thanks.
Alan
DECLARE @.Value float(53)
DECLARE @.ValueRounded float(53)
SET @.Value = -.024 -- Any negative number < .05
SELECT @.Value
SET @.ValueRounded = ROUND(@.Value, 1)
SELECT @.ValueRounded
SELECT CONVERT(CHAR(6), @.ValueRounded)What about this?
DECLARE @.Value float(53)
DECLARE @.ValueRounded decimal(6,1)--convert to decimal
SET @.Value = -.024 -- Any negative number < .05
SELECT @.Value
SET @.ValueRounded = ROUND(@.Value, 1)
SELECT @.ValueRounded
SELECT CONVERT(CHAR(6), @.ValueRounded)
Denis the SQL Menace
http://sqlservercode.blogspot.com/
Alan Z. Scharf wrote:
> Hi,
> I'm trying to round a very small negative number, e.g. -.024, to a string.
> If I round -.024 to 1 place, I get 0.0
> However, when converting to string, I get .-0
> Is there some combination of functions to get rid of the minus sign in suc
h
> a situation, or do I have to put in an IF condition to check if number < .
05
> and change it to ABS?
> Below is code that is resulting in -0.
> Thanks.
> Alan
>
> DECLARE @.Value float(53)
> DECLARE @.ValueRounded float(53)
> SET @.Value = -.024 -- Any negative number < .05
> SELECT @.Value
> SET @.ValueRounded = ROUND(@.Value, 1)
> SELECT @.ValueRounded
> SELECT CONVERT(CHAR(6), @.ValueRounded)|||Menace,
Thanks very much. I figured there must be a way.
Alan
"SQL Menace" <denis.gobo@.gmail.com> wrote in message
news:1149092714.650915.239590@.j55g2000cwa.googlegroups.com...
> What about this?
>
> DECLARE @.Value float(53)
> DECLARE @.ValueRounded decimal(6,1)--convert to decimal
> SET @.Value = -.024 -- Any negative number < .05
> SELECT @.Value
> SET @.ValueRounded = ROUND(@.Value, 1)
> SELECT @.ValueRounded
> SELECT CONVERT(CHAR(6), @.ValueRounded)
>
> Denis the SQL Menace
> http://sqlservercode.blogspot.com/
> Alan Z. Scharf wrote:
string.
such
.05
>|||Is this what u need?
DECLARE @.Value float(53)
SET @.Value = -.025
SELECT ABS(Floor(@.Value))
Regards
Sudarshan Selvaraja
"Alan Z. Scharf" wrote:

> Hi,
> I'm trying to round a very small negative number, e.g. -.024, to a string.
> If I round -.024 to 1 place, I get 0.0
> However, when converting to string, I get .-0
> Is there some combination of functions to get rid of the minus sign in suc
h
> a situation, or do I have to put in an IF condition to check if number < .
05
> and change it to ABS?
> Below is code that is resulting in -0.
> Thanks.
> Alan
>
> DECLARE @.Value float(53)
> DECLARE @.ValueRounded float(53)
> SET @.Value = -.024 -- Any negative number < .05
> SELECT @.Value
> SET @.ValueRounded = ROUND(@.Value, 1)
> SELECT @.ValueRounded
> SELECT CONVERT(CHAR(6), @.ValueRounded)
>
>
>|||BTW, FLOAT is an approximate representation. You would probably be better
off representing your data as a NUMERIC type.
"Alan Z. Scharf" <ascharf@.grapevines.com> wrote in message
news:Od%23oc2MhGHA.3756@.TK2MSFTNGP02.phx.gbl...
> Hi,
> I'm trying to round a very small negative number, e.g. -.024, to a string.
> If I round -.024 to 1 place, I get 0.0
> However, when converting to string, I get .-0
> Is there some combination of functions to get rid of the minus sign in
> such
> a situation, or do I have to put in an IF condition to check if number <
> .05
> and change it to ABS?
> Below is code that is resulting in -0.
> Thanks.
> Alan
>
> DECLARE @.Value float(53)
> DECLARE @.ValueRounded float(53)
> SET @.Value = -.024 -- Any negative number < .05
> SELECT @.Value
> SET @.ValueRounded = ROUND(@.Value, 1)
> SELECT @.ValueRounded
> SELECT CONVERT(CHAR(6), @.ValueRounded)
>
>
>|||>> I'm trying to round a very small negative number, e.g. -.024, to a string
. <<
Why are you formatting data in the back end? The basic principle of a
tiered architecture is that display is done in the front end and never
in the back end. This a more basic programming principle than just SQL
and RDBMS.