Solved

Find image size of image data column in MSSQL

Posted on 2007-11-17
4
6,052 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

932 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

10 Experts available now in Live!

Get 1:1 Help Now