MS SQL 2005 insert huge text file as one object

Hi Experts,

The question is how do I insert a very huge lets say 2-3MB file as one object into MS SQL 2005 column ?
Is it realistic ? Because I cannot see any data types [except BLOBs] > 8000 bytes :)
BULK is not an option because it just I think insert line as one separate row which does not fit into my
project specs. If I go with BLOB how do I do it ?

Thanks.


LVL 1
fpoyavoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Expert1701Commented:
In SQL Server 2005, you can use the new varchar(MAX) type which supports up to 2 GB of text.
0
fpoyavoAuthor Commented:
Is there link at microsoft that may prove it ?
I can't find it.
0
Expert1701Commented:
"Microsoft SQL Server 2005 introduces the max specifier. This specifier expands the storage capabilities of the varchar, nvarchar, and varbinary data types. varchar(max), nvarchar(max), and varbinary(max) are collectively called large-value data types. You can use the large-value data types to store up to 2^31-1 bytes of data."

Using Large-Value Data Types (SQL Server 2005 Books Online)
http://msdn2.microsoft.com/en-us/library/ms178158.aspx
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Expert1701Commented:
You can also read about it here: http://www.teratrax.com/articles/varchar_max.html
0
fpoyavoAuthor Commented:
Hi 1701,

I see note there : When the sp_tableoption stored procedure 'large value types out of row' option is set to OFF, the in-row storage limit for large-value types is 8,000 bytes. A 16-byte root is stored in-row when this option is set to ON.

So I assume that it has to be set in DB properties. I looked but found nothing like this because its for stored procedure. Does MS SQL 2005 sets by default to accept 2GB in one column ?

Thanks.
0
Expert1701Commented:
Whether the data is stored in-row or out-of-row will not make a difference; the varchar(MAX) column will be accessible exactly as it was any other varchar column, except it will support larger amounts of text.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.