0

Hi,

I'm trying to move "leftover" data from one database table to another after the user clicked on a button. Please can anyone give me some advise. This is kinda really urgent plz.

Everytime i run my app it gives no error but also doesn't move my data. :angry:
I'm using a stored procedure and this is my code:

ALTER PROCEDURE dbo.MoveDeleteUplHis
	/*
	(
	@parameter1 int = 5,
	@parameter2 datatype OUTPUT
	)
	*/
	@tel text
AS
SET IDENTITY_INSERT CompanyHistory ON
INSERT INTO CompanyHistory (CH_ID, CH_Tel, CH_SDT, CH_Duration, CH_Transaction, CH_Destination, CH_Amount, CH_Roaming, CH_Discount, CH_Status) 
SELECT Upl_ID, Upl_Tel, Upl_SDT, Upl_Duration, Upl_Transaction, Upl_Destination, Upl_Amount, Upl_Roaming, Upl_Discount, Upl_Status
FROM Upload WHERE Upl_Tel LIKE @tel;
SET IDENTITY_INSERT CompanyHistory ON

DELETE FROM Upload WHERE Upl_Tel LIKE @tel;

	/* SET NOCOUNT ON */ 
	RETURN

Edited by phoenix_dwarf: Missing code

1
Contributor
2
Replies
3
Views
8 Years
Discussion Span
Last Post by phoenix_dwarf
0

Well I saw now that if i take out "WHERE Upl_Tel LIKE @tel" it works but now it also moves the data that i dont want moved??? Any ideas...

0

NVM! I found out this code works 100% perfectly...my bad! (I converted a string to an int and so lost some zero values and that was my problem) tnx anyway!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.