Showing posts with label varbinary. Show all posts
Showing posts with label varbinary. Show all posts

Friday, March 30, 2012

Modify /concatenate varbinary data in SQL Server 2005

I am trying to store large files /images in SQL Server 2005.

I have used varbinay data type for the table column. At front end i am storing value in blob and inserting record to this table. but SQL Server does not allow to insert directly blob data to varbinary . So we need to convert blob data to varbinary using convert() function. After conversion, check the data ,it gives some junk values. How do i insert blob data into table with column data type as varbinary ?

2) We are trying to send blob data to SQL server 2005 in chunks. How to do it if column in table is varbinary ?

Please advice.

Regards

Rithik

You can check the following article to get the idea.

Insert BLOB from ADO.NET

http://support.microsoft.com/kb/309158

Learn more facts about BLOB when you design database

http://www.microsoft.com/technet/prodtechnol/sql/2000/reskit/part3/c1161.mspx?mfr=true

|||

Hi,

Thanks for your advice.

We are using powerbuilder 10 as front end and sql server 2005 as database. We use updateblob statement to update blob data to varbinary column in SQL Server script as follows.

1)Script :

UpdateBlob r_test Set blob_data = :lblob_filedata Where file_id =21;

2)And we used stored procedure as follows:

CRAETE PROCEDURE [dbo].[R_UPLOAD_FILES_TO_DB]
(
@.V_SOURCE_DATA VARBINARY(MAX),
@.V_FILE_ID NUMERIC(8)
)
AS

UPDATE R_TEST
SET DATA = @.V_SOURCE_DATA WHERE FILE_ID = @.V_FILE_ID

Blob data can have text files,bitmap files ,or any other file having size less than 2 GB.

The Table R_test Design :

Create table r_test

(data varbinary(max),fle_id numeric(8))

But when we checked the data we found it's not same.

SQL Server varbinary column stored blob data in different format. Why the data appears different ?

Please advice

Regards

Rithik

|||I want to store binary data in database. I have byte array, but i am unable to insert that in database because i don't know how to insert variable name of type BYTE in sql insert query.

my code is as follow

dim byteArray() as byte

strSQL = "INSERT INTO TEMP(TEMP_NAME,TEMP_BIN) VALUES('SANSHARK',?)"

how do i pass my byteArray in ?sql

Monday, March 19, 2012

Missing VarBinary(MAX) filestream storage attribute

Hi
I found the filestream attribute in Beta 1 new features list, but
cannot find any reference to it in the CTP documentation. It allows
direct access to word documents stored in a VarBinary(MAX) column. By
direct access I mean a file path\name to the file as stored in the
database using SQL Server FileStream Agent, also this removes the 2GB
restriction on file size.
Thanks in Advance
vihsFilestream was cut from the SQL Server 2005 shortly after Beta 1.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
"vihs" <sanantram@.yahoo.com> wrote in message
news:1122310275.649266.69620@.g43g2000cwa.googlegroups.com...
> Hi
> I found the filestream attribute in Beta 1 new features list, but
> cannot find any reference to it in the CTP documentation. It allows
> direct access to word documents stored in a VarBinary(MAX) column. By
> direct access I mean a file path\name to the file as stored in the
> database using SQL Server FileStream Agent, also this removes the 2GB
> restriction on file size.
> Thanks in Advance
> vihs
>