|
Home > Archive > MS SQL Server > March 2006 > Urgent help requested. Query does not return values but they are in table
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Urgent help requested. Query does not return values but they are in table
|
|
|
| I have a simple table named Postes the sql statement that my program
executes is select * from postes where IdPosteTelephonie = '12345678900'
This has worked flawlesly for ages. Now suddenly the statement returns an
empty redordset although when I go through the table I can find the record
whose field IdPosteTelephonie has value 12345678900. Its in the table.
I ran a dbcc on the database and got no errors returned.Tried it again after
the dbcc , still same results. Everything else on the computer seems to work
OK.
Weirdest thing I've seen so far. I desperateley need good help. This is on
a vital production system.
Thanks for any help you may provide.
Bob
| |
| Jack Vamvas 2006-03-09, 11:23 am |
| 1)What datatype is the column ?
--
Jack Vamvas
____________________
_______________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
"Bob" <bdufour@sgiims.com> wrote in message
news:uuH8bx4QGHA.4740@TK2MSFTNGP14.phx.gbl...
> I have a simple table named Postes the sql statement that my program
> executes is select * from postes where IdPosteTelephonie = '12345678900'
>
> This has worked flawlesly for ages. Now suddenly the statement returns an
> empty redordset although when I go through the table I can find the record
> whose field IdPosteTelephonie has value 12345678900. Its in the table.
>
> I ran a dbcc on the database and got no errors returned.Tried it again
after
> the dbcc , still same results. Everything else on the computer seems to
work
> OK.
>
> Weirdest thing I've seen so far. I desperateley need good help. This is on
> a vital production system.
>
> Thanks for any help you may provide.
>
> Bob
>
>
>
>
>
>
>
| |
| Erwin Moller 2006-03-09, 11:23 am |
| Bob wrote:
> I have a simple table named Postes the sql statement that my program
> executes is select * from postes where IdPosteTelephonie = '12345678900'
>
> This has worked flawlesly for ages. Now suddenly the statement returns an
> empty redordset although when I go through the table I can find the record
> whose field IdPosteTelephonie has value 12345678900. Its in the table.
>
> I ran a dbcc on the database and got no errors returned.Tried it again
> after the dbcc , still same results. Everything else on the computer seems
> to work OK.
>
> Weirdest thing I've seen so far. I desperateley need good help. This is on
> a vital production system.
>
> Thanks for any help you may provide.
>
> Bob
Hi,
Did by any chance somebody change the datatype of that column from (eg)
varchar to text?
And what happens if you run that query directly in Query Analyzer?
Regards,
Erwin Moller
| |
|
| Thanks , it a varchar column, it always contains 12 characters, I opened the
table in sql server explorer and manualy rewrote the correct value in it,
now it works, so there must have been something wrong with the data in the
field, although I could not see anything wrong when just looking at it and I
had treid cutting and pasting the field value from the table to my sql
statement in query analyzer. Anyways it seems to work again.
Now all I got to solve is why all of a sudden my apps on another computer
won't connect to sql server. Some idiot must have benn screwing around with
the network settings again. Oh well that's life, Thanks guys.
Bob
"Bob" <bdufour@sgiims.com> wrote in message
news:uuH8bx4QGHA.4740@TK2MSFTNGP14.phx.gbl...
>I have a simple table named Postes the sql statement that my program
>executes is select * from postes where IdPosteTelephonie = '12345678900'
>
> This has worked flawlesly for ages. Now suddenly the statement returns an
> empty redordset although when I go through the table I can find the record
> whose field IdPosteTelephonie has value 12345678900. Its in the table.
>
> I ran a dbcc on the database and got no errors returned.Tried it again
> after the dbcc , still same results. Everything else on the computer seems
> to work OK.
>
> Weirdest thing I've seen so far. I desperateley need good help. This is on
> a vital production system.
>
> Thanks for any help you may provide.
>
> Bob
>
>
>
>
>
>
>
|
|
|
|
|