SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Asking on Image Data Type


Asking on Image Data Type

Author
Message
snowfrost.c
snowfrost.c
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 18
Hi everyone,
I have an Image data type field in one of my table and is used to store my uploading of file. Can I confirm that the file is stored in the database as binary data and the file is not being stored somewhere in the SQL server ?

Thank You.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62920 Visits: 13298
snowfrost.c (5/15/2014)
Hi everyone,
stored in the database <---> stored somewhere in the SQL server ?


What's the difference?


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Eirikur Eiriksson
Eirikur Eiriksson
SSC-Forever
SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)SSC-Forever (40K reputation)

Group: General Forum Members
Points: 40910 Visits: 19475
Quick test would be checking with the the datalength function, if it corresponds to the file size, it is in the table.
Cool
Gianluca Sartori
Gianluca Sartori
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24157 Visits: 13362
snowfrost.c (5/15/2014)

Can I confirm that the file is stored in the database as binary data and the file is not being stored somewhere in the SQL server ?


I suppose that you want to know whether the file contents are stored as tabular data inside the database or in the file system.
If this is your question, the image data type is stored inside the database.

In SQL Server 2008 and newer you can add the filestream attribute to varbinary(max) columns to store the binary data in the filesystem and not inside the database tables.

--Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62920 Visits: 13298
spaghettidba (5/15/2014)
snowfrost.c (5/15/2014)

Can I confirm that the file is stored in the database as binary data and the file is not being stored somewhere in the SQL server ?


I suppose that you want to know whether the file contents are stored as tabular data inside the database or in the file system.
If this is your question, the image data type is stored inside the database.

In SQL Server 2008 and newer you can add the filestream attribute to varbinary(max) columns to store the binary data in the filesystem and not inside the database tables.


It is always stored in the database system (not in the file system), but not necessarily in the data pages themselves. If the contents are too large, the data row will just have a pointer to the pages where the actual string of bytes is stored.

You can control when the image is stored inside the data rows or not with sp_tableoption. (When it is bigger than the limit, it is not stored inside the actual data pages).

Using text and image Data

Anyhow, image is deprecated. Get rid of it :-D


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Gianluca Sartori
Gianluca Sartori
SSC-Insane
SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)SSC-Insane (24K reputation)

Group: General Forum Members
Points: 24157 Visits: 13362
Koen Verbeeck (5/15/2014)

Anyhow, image is deprecated. Get rid of it :-D


+1000

--Gianluca Sartori

How to post T-SQL questions
spaghettidba.com
@spaghettidba
aframiller326
aframiller326
SSC-Enthusiastic
SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)SSC-Enthusiastic (128 reputation)

Group: General Forum Members
Points: 128 Visits: 31
snowfrost.c (5/15/2014)
Hi everyone,
I have an
Image data type field in one of my table and is used to store my uploading of image file. Can I confirm that the file is stored in the database as binary data and the file is not being stored somewhere in the SQL server ?

Thank You.


Check this,

http://stackoverflow.com/questions/10353098/sql-server-checking-the-datatype-of-a-column

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/eed0fc85-f1c2-452b-a882-64e2f031d070/how-to-get-datatype-a-column-in-sqlserver-

Hope I understand your question in the right way.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search