Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the size of a image field content in SQL Server?

I have a table in SQL Server. This table has an image field and the application stores files in it.

Is there a way to read the size of the file in the image field using T-SQL?

like image 954
Fabio Avatar asked Apr 04 '12 21:04

Fabio


People also ask

What is the maximum size of image data type in SQL Server?

It's a variable size type with a maximum file size of 2GB. Although the Image data type is included in SQL 2005 and SQL 2008, it shouldn't be used.

What is image data type in SQL Server?

The IMAGE data type in SQL Server has been used to store the image files. Recently, Microsoft began suggesting using VARBINARY(MAX) instead of IMAGE for storing a large amount of data in a single column since IMAGE will be retired in a future version of MS SQL Server.

How do I find the size of a field in SQL?

Use COL_LENGTH() to Get a Column's Length in SQL Server In SQL Server, you can use the COL_LENGTH() function to get the length of a column. More specifically, the function returns the defined length of the column, in bytes. The function accepts two arguments: the table name, and the column name.

What is field size in SQL?

Field Size (Oracle) Field Size (SQL Server) Small Int. Contains whole numbers between -32768 and 32,767.


1 Answers

SELECT DATALENGTH(imagecol) FROM  table 

See MSDN

like image 92
Phil Avatar answered Sep 25 '22 04:09

Phil