Solved

Find image size of image data column in MSSQL

Posted on 2007-11-17
4
6,049 Views
Last Modified: 2012-08-13
I want to determine the size of the image I've uploaded into my MSSQL image data column. When I view the table in the SQL Server Enterprise Manager it only shows this: "<Binary>" and does not give any other information. I need to make sure my image script is actually uploading the image correctly, and I'm trying to do this by finding out the actual length in bytes of the image. Thank you in advance for any help.

Here's my @@version string:

Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Standard Edition NT 5.2 (Build 3790: Service Pack 2)
0
Comment
Question by:shady1024
  • 2
4 Comments
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 50 total points
ID: 20305447
please check out the DATALENGTH() function:
http://technet.microsoft.com/en-us/library/ms173486.aspx
0
 
LVL 31

Accepted Solution

by:
James Murrell earned 75 total points
ID: 20305473
SELECT DATALENGTH(image) FROM schematicsimage
0
 

Author Comment

by:shady1024
ID: 20314193
Thank you. I had seen an article that said use the data_length() function, which did not work. Now I see there's no underscore in the function name. Again, thank you very much for your prompt responses.
0
 
LVL 31

Expert Comment

by:James Murrell
ID: 20314907
Thanks happy to help
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now