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
Author
Message
Posted Friday, September 30, 2011 12:18 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, April 27, 2015 11:44 AM
Points: 172, Visits: 558
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.

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


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

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
http://www.sqlteam.com/article/introduction-to-transactions

and
http://www.codeproject.com/KB/database/sqlservertransactions.aspx

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.

Ron

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, June 18, 2015 2:24 AM
Points: 215, Visits: 330
Hi,
Remember SEAT for testing.

Table A
(
Column1 varchar(4),
Column2 int
)


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


Evaluate
Run the test/code

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


Assert
Select *
from A
inner join A_Changes
on Column2 = Column2

Tear down (Clean up)

Drop table A_Changes


Cheers

Jamie


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

Add to briefcase

Permissions Expand / Collapse