Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6088
  • Last Modified:

Find image size of image data column in MSSQL

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
shady1024
Asked:
shady1024
  • 2
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
please check out the DATALENGTH() function:
http://technet.microsoft.com/en-us/library/ms173486.aspx
0
 
James MurrellProduct SpecialistCommented:
SELECT DATALENGTH(image) FROM schematicsimage
0
 
shady1024Author Commented:
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
 
James MurrellProduct SpecialistCommented:
Thanks happy to help
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now