Page 1 of 1

Bug or something

Posted: Wed 25 May 2005 18:07
by Bagieta
I have strange problem while using Prepare statement.

I have a table

create table tab
(
Time datetime not null,
a uniqueidentifier not null
);

and call a statement:

select *
from tab
-- some comment
where a < :param

After calling prepare on that statement I can't work with database anymore.
This only happens if the table looks like that (datetime and uniqueidentifier). When columns are another type then it works fine.

The same thing is when there is no comment in sql statement.
Then it works ok.

But when a comment is befoer 'where' word then it crashes my database, and I cant work with it anymore.

Anyone had the same problem or resolved it?
Or maybe this is a bug?

Kind regards
Bagieta

Posted: Fri 27 May 2005 12:09
by Ikar
We couldn't reproduce the problem.

From our point of view, compare guid on "greater" or "less" makes no sense. Possible, developers of MS SQL also haven't tested this ability.

Try to convert a field to CHAR using, for example CAST

Posted: Fri 27 May 2005 16:37
by Bagieta
There is no connection with "greater" or "less" sing. There can also be a "=" sign.

To reproduce this situation try to use MSDE.
Create this table, execute or prepare that statement.
Then some error occurs. But it is ok.
The trouble is when you try to open another query. It gives you no records. The strange thing is that you can see the right columns but there are no data in the tables at all.
F.ex. try folowing query:
"select * from sysobjects"

I have no data in it after querying this problematic query.

This is not a big error for me but I only wanted to tell you that there is such a problem. Maybe in future you will meet something similar.

Posted: Mon 30 May 2005 08:51
by Ikar
Thank you for information. But the error, it seems, is in the code of server.