Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Using GetSqlBinary

Author  Topic 

Skydolphin
Starting Member

43 Posts

Posted - 2004-12-01 : 17:37:06
Hi all,

I have a unique problem (I think) I have a table that contains a few Image fields. We are developing a tool that allows users to backup certain information if they choose. It's kind of a content management for lack of a better description. What I am trying to do is read some records/fields from one table and then insert them into a different database/table. I'm not doing anything with the data just copying it from to another. I don't know how to write the insert for the image data.

I'm building the insert statement in pieces because data is coming from multiple places to be inserted into this table. What I have is something like this.

int iContent= ds.GetOrdinal("Content");
if ( ds.IsDBNull(iContent))
{
sInsertSQL = sInsertSQL + SqlBinary.Null + ", ";
}
else
{
sInsertSQL = sInsertSQL + ds.GetSqlBinary(iContent) + ", ";
}

Any help from you experts out there would be very much appreciated.

Thanks,

Rhonda

Rhonda

Skydolphin
Starting Member

43 Posts

Posted - 2004-12-01 : 18:59:25
I ended up inserting the record by using insert into table (field1, field2...) Select field1, field2...) Then if I had anything that needed to be added from another table I did an update.

Rhonda

Rhonda
Go to Top of Page
   

- Advertisement -