Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't delete record with VARBINARY(MAX) column 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I'm trying to store some PDF's in SQL as BLOBs, so have a VARBINARY(MAX) column, I have inserted binary data (@ 3mb) as a test into the table (there is only this one record).

I'm in SSMS and trying to delete this one test record but the query has been running for over 15 minutes?

Code:
DELETE FROM (table) WHERE ID = (recid)

What's wrong with SQL?

Why won't it let me delete a simple record from a table that only has one record with a measly PDF stored?

What am I doing wrong?

Thanks,
1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Sounds like a blocking issue. Try looking in the output of sp_who2, while the delete is running, to see if you can track down the rogue transaction.
 
Thanks yelworcm,

You must have been right as I tried first thing and it has deleted instantly, so the lock must have timed out overnight.

Not sure what was locking the record, it's a new table and only I am accessing currently while I develop the new application.

Regards,
1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
The usual suspects are open transactions you may have been playing with, or the GUI tools. The old SQL 2000 Enterprise Manager open Table application had a reputation for these things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top