Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BLOB Insert and Select of BIG Data

Status
Not open for further replies.

DenizD

Programmer
Nov 22, 2006
3
DE
Hello!

Consider you have the Table "Maps" with the following columns and
datatypes:
Map varbinary(MAX)
MD5 nchar(100)
Date datetime
ZipFileName nchar(100)

I wanted to insert a large Zip file into this table (422MB). I used
this statement:


INSERT INTO [mydbdd].[dbo].[Maps] (Map)
SELECT *
FROM OPENROWSET (
BULK 'D:\Maps\29_30_6.zip',
SINGLE_BLOB) AS TEMP


As you can see, I only write in the colum "Map" in the "Maps" table. My
question is:
What must the statement look like, to insert Data into the columns
MD5,Date and ZipFileName together with the Map (BLOB) in one
statement or transaction. If I tried one statment I got the error
message that no subset is allowed.

My other question is:
I used the statement above to insert small data (<1MB). If I inserted
the zip file (=422MB) and tried a select on the table in the managment
studio, I only got a table that said the columns where "read only"
(although I only wrote in the column "Map", the other columns had this
read only flag to). How to read a table with so much data? I would have
tried a SELECT with a WHERE clause, but this leads to the problem above
(inserting all columns in one statement).

I am looking forward to your answers.

Deniz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top