View Single Post

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

horton (horton_ellas@yahoo.com) writes:
> Erland Sommarskog <sommar@algonet.se> wrote in message

news:<Xns940F4BE2D4C2Yazorman@127.0.0.1>...
>> 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 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.
>


Northwind is an example database that ships with SQL Server since
version 7. If you don't have Northwind..Orders on your server, you
are either running SQL 6.5, or you have for some reason removed
Northwind from the server or at least dropped the Orders table in
it.

In in the Install directory for SQL Server you can find the file
instnwnd.sql that installs Northwind.

--
Erland Sommarskog, SQL Server MVP, sommar@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Reply With Quote