2015-03-31 52 views
0

我有一個.csv文件,其中有一列blob數據類型(來自cassandra),它是二進制數據。這些數據可能非常龐大 - 遠遠超過8000字節。如何將巨大的Blob導入SQL Server數據庫?

我試圖在SQL Server導入嚮導中設置源和目標數據類型DT_BYTES->binary/varbinary,但由於數據將被截斷的錯誤而失敗。

如何導入這些數據?

回答

1

您需要將列類型設置爲varbinary(max)而不是varbinary,以便該列將接受超過8000個字節。請參閱以下microsoft link

varbinary [ (n | max) ] 

Variable-length binary data. n can be a value from 1 through 8,000. 
max indicates that the maximum storage size is 2^31-1 bytes. 
The storage size is the actual length of the data entered + 2 bytes. 
The data that is entered can be 0 bytes in length. 
The ANSI SQL synonym for varbinary is binary varying. 

對於集成服務數據類型,您可以看看以下link。你想要的是DT_IMAGE:

DT_IMAGE 
A binary value with a maximum size of 231-1 (2,147,483,647) bytes. 
+0

VARBINARY(最大值)的等效的SSIS(進口源數據)是DT_BYTES,它被限制爲8000個字節,據我已瞭解。 – 2015-03-31 09:47:18

相關問題