Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

ETL DATA TESTING Expand / Collapse
Posted Friday, September 30, 2011 12:18 PM


Group: General Forum Members
Last Login: Tuesday, September 15, 2015 12:23 PM
Points: 185, Visits: 611
I have source side stored procedure.Using which i need to do analysis and write test cases.
In the stored procedure , they are updating data after wrting the stored procedure.Do any one know how to write testcases for update statments.

Post #1183878
Posted Friday, September 30, 2011 2:49 PM



Group: General Forum Members
Last Login: Sunday, January 4, 2015 7:55 AM
Points: 5,333, Visits: 25,280
To be honest I do not know of any "Standard" test procedure as you are requesting. But you can do a great deal of "testing", checking for "good practices" by examining the T-SQL statements. I would for example.

1. Each SP should include a TRY CATCH block - if some mistakes exist the TRY CATCH can be coded to return a appropriate error message.

2. Each SP should (in my opinion) have a BEGIN / COMMIT / ROLL BACK transaction. To some extent makes each SP check itself and "undo" errors. Try reading this


3. Visual examination to insure that each update SP has the appropriate WHERE clause. (MOST IMPORTANT)

Hope this gets you started.

If everything seems to be going well, you have obviously overlooked something.


Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1183957
Posted Thursday, May 28, 2015 1:27 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, October 1, 2015 9:44 PM
Points: 216, Visits: 351
Remember SEAT for testing.

Table A
Column1 varchar(4),
Column2 int

Select a row of data to be updated.
Select Column1, Column2 from A where Column1 Is Null

Run the test/code

Insert into A_Changes
Select Column1, Column2 from A where Column1 Is Null
Update A Set Column1 = 'TEST' where Column1 Is Null

Select *
from A
inner join A_Changes
on Column2 = Column2

Tear down (Clean up)

Drop table A_Changes



We are the pilgrims, master.
We shall go always, a little further.
Post #1689419
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse