Funny error | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Funny error

Hi, When I query for the some tables like below: SELECT COUNT(1) FROM Table-8
This gives result 1 But when I do like this
This shows no row in the table. This is happening most of the tables in my DB.[B)]
Cud you pls tell me what can be the possible reason. [V]
Ashish Johri
is Table-8 table name in your query really working without any syntax error?
I mean without enclosing the table name in Square brackets like select * from [table-8]
Hey I think that was some cache problem. now this is correct. Can I know how I can refresh cashe? Ashish Johri
DBCC FREEPROCCACHE – Remove all elements from the procedure cache.
DBCC FREESESSIONCACHE – Flush the distributed query connection cache.
DBCC FREESYSTEMCACHE – Release all unused cache entries from all caches.
DBCC DROPCLEANBUFFERS-Remove all clean buffers from the buffer pool.
quote:Originally posted by ashish.johri2007 Hey I think that was some cache problem. now this is correct. Can I know how I can refresh cashe?
That is very very unlikey.
Roji. P. Thomas
SQL Server MVP

Thanks Ranjit for this info. Regards,
Ashish Ashish Johri
Hi, I executed DBCC UpdateUsage(‘DBName’) command and this took almost 1 hour 35 min. Does this happen normally? I executed this command after I got an error as b’lo while doing DTS. I read somewhere that this command cleans up potential problems. "Information 0x4004800c: Data Flow Task: The buffer manager detected that the system was low on virtual memory, but was unable to swap out any buffers. 8 buffers were considered and 8 were locked. Either not enough memory is available to the pipeline because not enough is installed, other processes are using it, or too many buffers are locked." Regards,
Ashish Ashish Johri
quote:SELECT COUNT(1) FROM Table-8
This gives result 1

This exact query statement should actually give you an error message "Incorrect syntax near ‘-‘." Since the table name includes a hyphen, you must add square brackets around the name. So depending on how you’re executing the query, the "1" result could be the error return code.