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
 General SQL Server Forums
 New to SQL Server Programming
 Testing for Archival process

Author  Topic 

Rahul Raj
Starting Member

41 Posts

Posted - 2014-11-11 : 23:06:23
Hi,

I am currently working on a stored procedure which will delete records from multi tables. I want to know testing approach of how I can test the same in the DEV environment.

Do I need to create all new tables copying the structure and constraints from the original tables or can use the original tables.

As the tables are used by other developers as well in the DEV environment thereby I am not sure if any important data is deleted during my unit testing.

Can someone share the best approach to do this.

Rahul Raj
Starting Member

41 Posts

Posted - 2014-11-23 : 07:26:41
Hi,

Can someone please help on this.

just to add more information on this, there are around 60 tables on which the records needs to be deleted. I used the below syntax to copy the records from the orginal tables to the new tables into a different database.
select cust-ID from table1 where delete_flag = 1 /* selecting Cust-id for deleteion */

/* copying the eligible records into test table*/

select * into
newdb.test_table1
from table1
where custID in (select * from temp table)

But some of the test tables are not populated as the eligible records were not present thereby individually updating the records will be tedious task.

Can someone pls suggest a better approach.
Go to Top of Page
   

- Advertisement -