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:
ISQL -E -d tempdb -n -i atestneg.sql > atestneg.out
You mentioned that you did not get any output from ISQL, this sounds
funny.
Also if you can, try running against the same SQL Server from different
machines, and try running with your machine against other SQL Servers.
I have no idea of what's going on. But it seems that either something
is very funky with your data, or something is very funy with either
the server or client machine. I have actually seen an example of the latter,
although in that situation the problem was that the decimal point appeared
to be ignored on input. (This culprit then was running SQL Mail with
Outlook as mail client, if I remember correctly.)
--
Erland Sommarskog, SQL Server MVP,
sommar@algonet.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp