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

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...

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!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.