简体   繁体   中英

Storing a file in database with huge content

I tried a lot with the problem stated below, couldn't get an answer. I have a file with very huge content of texts up to 600 MB, i want to store it in a database. According to what I saw in http://www.w3schools.com/sql/sql_datatypes.asp , i used 'text' datatype in which up to 2 GB can be stored. But still when i retrieve back, I'm getting truncated file contents. It looks simillar to-

create table academics (
  semester int not null,
  subject varchar (50),
  experience text,  
  primary key (semester)
);

experience gets its value from a file with large contents. Which datatype can I use for the same?

Well, be careful with text . As stated here :

ntext , text, and image data types will be removed in a future version of Microsoft SQL Server. Avoid using these data types in new development work, and plan to modify applications that currently use them. Use nvarchar(max), varchar(max), and varbinary(max) instead.

Also, for such a large files you can consider using the FileTables if you're using SQL Server 2012+

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM