Here, knock yourself out...Understand that you'll need an iterative process to get all the blocks of data:CREATE PROCEDURE ImageTest3 -- @ptrValue varbinary(16) @Offset int , @Size int AS-- Execute ImageTest3---- Enterprise Solutions---- File: ImageTest3.sql-- Date: March 4th, 2002-- Author: Brett Kaiser-- Server: -- Database: ImageTest3-- Description: Investigate how to extract blobs fro SQL Server 7---- The stream will do the following:---- 1. -- -------- Tables Used:-- Table1---- -- Tables Created: None---- -- Row Estimates:-- name rows reserved data index_size unused -- -------------------- ----------- ------------------ ------------------ ------------------ ------------------ -- --Change Log---- UserId Date Description-- ----------- -------------- -------------------------------------------------------------------------------------------- x002548 12/14/2001 1. Initial release------Declare @error_out int, @Result_Count int, @Error_Message varchar(255), @Error_Type int, @Error_Loc intDeclare @ptrValue varbinary(16) BeginBegin Tran Select @ptrValue = TextPtr(imgPicture) from Table1 Where charKey = 'A' If TextValid('Table1.imgPicture', @ptrValue) <> 1 BEGIN Select @Error_Loc = 1 Select @Error_Message = 'Pointer value not valid. Value equals: ' + RTrim(Convert(Char(16),@ptrValue)) Select @Error_Type = 50002 GOTO ImageTest3_Error END ReadText Table1.imgPicture @ptrValue @Offset @Size Select @Result_Count = @@ROWCOUNT, @error_out = @@error If @error_out <> 0 BEGIN Select @Error_Loc = 2 Select @Error_Type = 50001 GOTO ImageTest3_Error END If @Result_Count = 0 BEGIN Select @Error_Loc = 2 Select @Error_Message = 'Could Not find image for pointer value ' + RTrim(Convert(Char(16),@ptrValue)) Select @Error_Type = 50002 GOTO ImageTest3_Error END If @Result_Count > 1 BEGIN Select @Error_Loc = 2 Select @Error_Message = 'Found multiple images for pointer value ' + RTrim(Convert(Char(16),@ptrValue)) Select @Error_Type = 50002 GOTO ImageTest3_Error ENDEndImageTest3_Exit:COMMIT TRAN ReturnImageTest3_Error:Rollback TRANIf @Error_Type = 50001 BEGIN Select @error_message = (Select 'Location: ' + RTrim(Convert(char(3),@Error_Loc)) + ' @@ERROR: ' + RTrim(Convert(char(6),error)) + ' Severity: ' + RTrim(Convert(char(3),severity)) + ' Message: ' + RTrim(description) From master..sysmessages Where error = @error_out) ENDIf @Error_Type = 50002 BEGIN Select @Error_Message = 'Location: ' + RTrim(Convert(char(3),@Error_Loc)) + ' Severity: UserLevel ' + ' Message: ' + RTrim(@Error_Message) ENDRAISERROR @Error_Type @Error_MessageReturnGO
Brett8-)