Groups | Blog | Home
all groups > sql server odbc > april 2004 >

sql server odbc : BLOB as primary key


Jacky Luk
4/24/2004 10:23:01 AM
In SQL Server, Can you set a BLOB field as the primary key? Also in mySQL?
Thanks
Jack

Jacco Schalkwijk
4/26/2004 2:20:41 PM
BLOBs in SQL Server are usually stored in columns with datatype image, and
you can't create a Primary Key on a column with datatype image. You can use
varbinary as the datatype for your blob column, but you will be limited to
900 bytes as the maximum length.

MySQL might allow it. Data integrity is not a major concern with the
designers of MySQL. Don't be surprised that if MySQL does allow you to
create a Primary Key on a BLOB, it might actually only create a Primary Key
on the first 100 bytes or so of the BLOB, without notifying you that it does
this.

--
Jacco Schalkwijk
SQL Server MVP


[quoted text, click to view]

AddThis Social Bookmark Button