Solved

Microsoft SQL Server 2005 and longblob

Posted on 2006-06-22
6
1,798 Views
Last Modified: 2012-05-05
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?
0
Comment
Question by:johnywhite
6 Comments
 
LVL 20

Expert Comment

by:Sirees
ID: 16959625
Image
0
 
LVL 20

Expert Comment

by:Sirees
ID: 16959628
0
 
LVL 13

Expert Comment

by:devsolns
ID: 16959679
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
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 27

Expert Comment

by:ptjcb
ID: 16959700
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).
0
 
LVL 20

Accepted Solution

by:
Sirees earned 500 total points
ID: 16959706
SQL Server 2005 has new VARCHAR(MAX) data type - along with NVARCHAR(MAX) and VARBINARY(MAX) - with the ability to store up to 2GB of data, supplementing TEXT, NTEXT, and IMAGE data types.

Source: http://www.databasejournal.com/features/mssql/article.php/10894_3432541_2
0
 

Expert Comment

by:Dr3Pc
ID: 17097323
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.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now