View Single Post

   
  #7 (permalink)  
Old 02-28-2008, 07:31 PM
horton
 
Posts: n/a
Default Re: Query Analyzer shows negative numbers as positive numbers

Erland Sommarskog <sommar@algonet.se> wrote in message news:<Xns940F4BE2D4C2Yazorman@127.0.0.1>...
> pj (peterjohannsen@hotmail.com) writes:
> > Then I run an insert similar to this:
> >
> > insert into atestneg(dollars)
> > select my_real_values from my_real_table
> > where my_real_values<0
> >
> > select * from atestneg order by dollars

>
> Since we don't have you real table and values it is difficult to
> reproduce. Could you try this script:
>
> drop table atestneg
> go
> create table atestneg (dollars decimal(15,2) null)
> go
> insert into atestneg (dollars) values (1)
> go
> insert into atestneg (dollars) values (-1)
> go
> insert into atestneg (dollars) values (-2)
> go
> insert into atestneg (dollars)
> select Freight - 10
> FROM Northwind..Orders
> where Freight < 10
> go
> select * from atestneg order by dollars
>
> and report what you see. (Preferably by including the output as
> attachment.) Please run both in Query Analyzer and in OSQL and ISQL.
> To run from the latter, save in a file and say:



Server: Msg 3701, Level 11, State 5, Line 1
Cannot drop the table 'atestneg', because it does not exist in the system catalog.

(1 row(s) affected)


(1 row(s) affected)


(1 row(s) affected)

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'Northwind..Orders'.


Obviously this is going to fail in isql & osql as well,
because of the reference to the nonexistent table Northwind..Orders.

Reply With Quote