2017-07-27 124 views
-3

我試圖創建一個圖像數據庫,到目前爲止,我得到這個從網上:無法找到數據類型BLOB

CREATE TABLE testblob (
image_id tinyint not null default '0', 
image_type varchar(25) not null default '', 
image blob not null, 
image_size varchar(25) not null default '', 
image_ctgy varchar(25) not null default '', 
image_name varchar(50) not null default '', 
); 

而且我得到這個錯誤:

Msg 2715, Level 16, State 6, Line 1 Column, parameter, or variable #3: Cannot find data type blob

+0

您可能希望從'');''... – Egg

+1

之前刪除尾隨逗號來開始使用VARBINARY(MAX)來代替BLOB。 –

回答

0

試試這個

/****** Object: Table [dbo].[testblob] Script Date: 7/27/2017 7:53:08 PM ******/ 
SET ANSI_NULLS ON 
GO 

SET QUOTED_IDENTIFIER ON 
GO 

SET ANSI_PADDING ON 
GO 

CREATE TABLE [dbo].[testblob](
    [image_id] [tinyint] NOT NULL, 
    [image_type] [varchar](25) NOT NULL, 
    [image] [varbinary](max) NOT NULL, 
    [image_size] [varchar](25) NOT NULL, 
    [image_ctgy] [varchar](25) NOT NULL, 
    [image_name] [varchar](50) NOT NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] 

GO 

SET ANSI_PADDING OFF 
GO 

ALTER TABLE [dbo].[testblob] ADD DEFAULT ('0') FOR [image_id] 
GO 

ALTER TABLE [dbo].[testblob] ADD DEFAULT ('') FOR [image_type] 
GO 

ALTER TABLE [dbo].[testblob] ADD DEFAULT ('') FOR [image_size] 
GO 

ALTER TABLE [dbo].[testblob] ADD DEFAULT ('') FOR [image_ctgy] 
GO 

ALTER TABLE [dbo].[testblob] ADD DEFAULT ('') FOR [image_name] 
GO 
相關問題