Link to home
Start Free TrialLog in
Avatar of johnywhite
johnywhite

asked on

Microsoft SQL Server 2005 and longblob

I have small upload program that I wrote for MySQL.  It uploads to a longblob field.  What would be the equivilant in Microsoft SQL Server 2005?
Avatar of Sirees
Sirees

Image
Well, it is ntext, text, and image data types.  BUT they 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.

--DS
Is this an image or a text object? If it is an image, then SQL has the image data type. If it is a text, then varchar(max) or varbinary(max).
ASKER CERTIFIED SOLUTION
Avatar of Sirees
Sirees

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if your running MS SQL 2000, take a look at this feed

http://forums.mysql.com/read.php?60,18474,30679

It migrates from MySQL to MSSQL.

If your running MS SQL 2005 or later, then you should use the VARBINARY(MAX) field. Being LONGBLOB, this is a type of Binary field, so this is most appropriate.

Although in the MySQL documentation, it states that LONGBLOB can habve up to 4GB or (2^32-1), From everything I have read and my own experience, it is only possible to reach 1GB. This may actually be an aid as MSSQL offers only up to 2GB. Keep in mind for the future, if you need to migrate fields back to MySQL, don't make them larger than 1GB in MSSQL.

Hope this helps.