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
 SQL Server Development (2000)
 Stored Procedure - Move images between tables

Author  Topic 

myksdsu
Starting Member

13 Posts

Posted - 2007-05-11 : 13:02:18
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

Kristen
Test

22859 Posts

Posted - 2007-05-11 : 13:11:34
Duplciate of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83478
Go to Top of Page

myksdsu
Starting Member

13 Posts

Posted - 2007-05-11 : 13:35:10
Is it not ok to post in two different places?

Sorry if it is not allowed.
Mike
Go to Top of Page

polohero
Starting Member

1 Post

Posted - 2007-05-11 : 13:36:47
I am experiencing a similar problem. Any ideas as to what could be the issue??
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-11 : 13:52:28
are you sure you're getting the correct results?
this part: FROM Test_Base b,Test_Run r
looks fishy to me.


_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-05-11 : 13:55:08
"Is it not ok to post in two different places?"

@myksdsu:

Well the issue is that folk respond when they see a post. That means that people can spend time working up solutions only to discover that someone else has already done all that work in another, duplicate, thread. Folk here give their time for free, so they can get pretty chewed off if they could have been giving their time to someone else rather than duplicating work already done.

So when duplicates are posted we post a link to the other thread, and then if folk find the post, however they get to it, they can answer in the main thread.

@polohero:

"I am experiencing a similar problem. Any ideas as to what could be the issue??"

Please monitor the followups in the thread linked above

Kristen
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-05-11 : 13:55:42
P.S. I don't know the answer to your question, otherwise I would have posted an answer as well as a Dupe Link
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-05-11 : 23:25:09
quote:
Originally posted by Kristen

Duplciate of http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83478


Now it became circular reference

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-05-12 : 01:19:19
I think this would have been better continued in
SQL Server Development (2000)
rather than here in
New to SQL Server
However the other thread is now locked.

Kristen
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-05-12 : 14:28:15
i'll move this topic to the sql server 2000 forum.
please delete the other topic.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
   

- Advertisement -