Link to home
Start Free TrialLog in
Avatar of popnetworks
popnetworks

asked on

ODBC Call Failed Error 3146

I'm using SQL 6.5 under WinNT. When I try and add/delete information from my database I keep getting an ODBC call failed error. I have truncated the log and though it looks empty when I run a dbcc checktable(syslogs) and dbcc sqlperf (logspace) when I say edit DB it still looks as full as it was. I've truncated, restored from a previous backup, but no luck. I am NOT a sql expert so any help would be appreciated.
Avatar of Victor Spiridonov
Victor Spiridonov
Flag of Russian Federation image

What application are you using to add,delete records? Do you have enough permissions? Are you logged in as sa? ODBC call failed is only a generic first part of the error message, there should be second part containing error returned by SQL Server.
Avatar of tunct
tunct

3146 is something like a timeout error code... I usually got it when the db was full or the server was performing a heavy task.

The transaction log fills up quickly if you have large transactions (logical, ain't it :). So you may choose to "truncate log on checkpoints", which means, after each successful transaction, the log is discarded.

T.
ps: Is the log on a separate device?
If I remember correctly, 'Truncate Log on Checkpoint' it only truncates the log after a dump to the last successful transaction before the checkpoint.  What may have happened is you have a hung transaction in the log.  If this transaction is at the end of the log, it will not truncate properly.  I've had this problem before, and I'm trying to remember how I fixed it.  I want to say I dumped the database, dropped the database and its devices, and then recreated it from scratch.  Not a good solution, though.  I will continue to think about it.  You may want to see what the way is to determine the hung transactions in the log, and how to clear them.  I think that will get you on the right track.

Later,
Martin
Avatar of popnetworks

ASKER

Yes, I was logged in as sa, did have enough permissions and was using a VB created client application to access the server. I checked both the server and operating system logs but could not find other information on the error. The log was on a separate device. Yesterday I had it and deleted everything, reinstalled SQL, installed Service Pack 4, recreated my database and log devices and recreated my database from a recent backup. I deleted old tables and rows from my db as it had grown to over 1gb (probably not the best idea but it was info I didn't need), I truncated the log (again) and performed some dbcc commands to check the status of the tables and logs. I did get the message that the number of data pages and rows in my Sysindexes were corrected from some awfully large numbers to 1 and 12 respectively. Now I seem to be ok. I did make sure the truncate log on checkpoint was active and I'm HOPING I won't get this error again! Any additional thoughts? (besides to upgrade to 7.0 when it comes out?)
ASKER CERTIFIED SOLUTION
Avatar of Victor Spiridonov
Victor Spiridonov
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i have encountered this problem before, but i do not know why it happenned.,in fact, i couldn't add any new row in the table,,,
what i have done is the following :
for example if the damaged table name is "table1"
-first , go to sql enterprise and rename this table to "otable1"
 -then go to Ms Query and write down the following

select *
into table1
from otable1
 THIS CODE WILL create a new table from the old one
-After creating table1, goto sql server enterprise, select table1 and reestablish its primary key...
hoping it works..
regards
zeina