Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Asking on Image Data Type Expand / Collapse
Author
Message
Posted Thursday, May 15, 2014 12:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 6, 2014 10:22 AM
Points: 4, 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.
Post #1571144
Posted Thursday, May 15, 2014 12:38 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 11:26 AM
Points: 13,622, Visits: 10,514
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1571146
Posted Thursday, May 15, 2014 12:39 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 10:33 PM
Points: 1,776, Visits: 4,647
Quick test would be checking with the the datalength function, if it corresponds to the file size, it is in the table.
Post #1571147
Posted Thursday, May 15, 2014 2:05 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:45 AM
Points: 5,018, Visits: 10,536
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

Get your two-cent-answer quickly
spaghettidba.com
@spaghettidba
Post #1571173
Posted Thursday, May 15, 2014 2:29 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 11:26 AM
Points: 13,622, Visits: 10,514
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




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

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1571182
Posted Thursday, May 15, 2014 2:47 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:45 AM
Points: 5,018, Visits: 10,536
Koen Verbeeck (5/15/2014)

Anyhow, image is deprecated. Get rid of it


+1000


--
Gianluca Sartori

Get your two-cent-answer quickly
spaghettidba.com
@spaghettidba
Post #1571188
Posted Wednesday, May 21, 2014 3:57 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, May 21, 2014 3:51 AM
Points: 10, 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.
Post #1573056
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse