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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storedprocedure moving images between tables

Status
Not open for further replies.

myksdsu

Programmer
May 12, 2007
1
US
I have two tables: Test_Base and Test_Run
When a test is approved i have a stored procedure to move two columns from Test_Run to Test_Base

Column 1: WriteFileLoc (varchar)
Column 2: image (xml file in a byte[])

However, when i execute the following procedure it moves an empty image = 0x

Any ideas to why it moves the varchar but not the image (the image i want to move isn't empty)?

CREATE PROCEDURE dbo.au_InsertFileListXml ( @RunID varchar(50))
AS

DECLARE @BaseID varchar(50)
DECLARE @WriteFileLoc varchar(50)

SELECT @BaseID = Test_ID, @WriteFileLoc = Test_WriteFileLoc FROM Test_Run WHERE Test_Run_ID = @RunID

IF @WriteFileLoc = 'N'
UPDATE Test_Base SET Test_FR_FileList_N = r.Test_FR_FileList_N, Test_WriteFileLoc = @WriteFileLoc FROM Test_Base b,Test_Run r WHERE b.Test_ID = @BaseID;
ELSE IF @WriteFileLoc = 'Y'
UPDATE Test_Base SET Test_FR_FileList_Y = r.Test_FR_FileList_Y, Test_WriteFileLoc = @WriteFileLoc FROM Test_Base b,Test_Run r WHERE b.Test_ID = @BaseID;
GO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top