SQL Server Bug or Query Bug? 
Author Message
 SQL Server Bug or Query Bug?
Ok, I run the following query:



select ObjectType from ObjectPermission where

And no results are returned

Then, I run this query:

select ObjectType from ObjectPermission where
[ObjectType] = 'FolderNode'

And 100 results are returned. Any idea what is going on
here? Is this a SQL bug, or am I just missing something.



Wed, 11 Jan 2006 18:41:41 GMT
 SQL Server Bug or Query Bug?

FYI:

I would check the type, size and collation of the column [ObjectType] .
Could be an char vs varchar or nvarchar vs varchar or an collation issue.


Quote:
> Ok, I run the following query:



> select ObjectType from ObjectPermission where

> And no results are returned

> Then, I run this query:

> select ObjectType from ObjectPermission where
> [ObjectType] = 'FolderNode'

> And 100 results are returned. Any idea what is going on
> here? Is this a SQL bug, or am I just missing something.



Wed, 11 Jan 2006 18:54:51 GMT
 SQL Server Bug or Query Bug?
Nevermind... it was something stupid. Need to put VARCHAR
length (like VARCHAR(255)).
Quote:
>-----Original Message-----
>Ok, I run the following query:



>select ObjectType from ObjectPermission where

>And no results are returned

>Then, I run this query:

>select ObjectType from ObjectPermission where
>[ObjectType] = 'FolderNode'

>And 100 results are returned. Any idea what is going on
>here? Is this a SQL bug, or am I just missing something.
>.



Wed, 11 Jan 2006 19:01:33 GMT
 SQL Server Bug or Query Bug?
Hello Jesse,
You are missing on a simple fact. Varchar alone is one character long, so
your query obviously will not run. Use something like varchar(25). The best
is to use the actual length definition of the column in the table.

Hope this helps (it should!)
Raj Moloye



Wed, 11 Jan 2006 19:04:57 GMT
 SQL Server Bug or Query Bug?

Try



select ObjectType from ObjectPermission where

a variable with VARCHAR will have a default length of 1.

HTH
Srinivas Sampangi

Quote:
>-----Original Message-----
>Ok, I run the following query:



>select ObjectType from ObjectPermission where

>And no results are returned

>Then, I run this query:

>select ObjectType from ObjectPermission where
>[ObjectType] = 'FolderNode'

>And 100 results are returned. Any idea what is going on
>here? Is this a SQL bug, or am I just missing something.
>.



Wed, 11 Jan 2006 19:07:28 GMT
 
 [ 5 post ] 

 Relevant Pages 

1. BUGS idapi BUGS idapi BUGS idapi BUGS

2. Bugs, Bugs, Bugs ...

3. BUG BUG BUG: VB5+DAO 3.51

4. BUGS BUGS BUGS (Disappointed with Borland!)

5. WAS BUG, BUG, BUG

6. Distributed queries bug in SQL Server 2000

7. SQL Server 2000 Distributed queries bug

8. Query bug in SQL Server 7.00.623 !?

9. SQL Server Bug: Query returning wrong results repro

10. update query bug on sql server 2000

11. SQL Server 6.5 Query planner bug/error?

12. ** SQL bug or Delphi bug ???


 
Powered by phpBB® Forum Software