Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

Data Validations

$
0
0

We have around 10k records

in stagingtable which needto be validated. The below validtions areas follows. Could you please help to have the T-SQL code to validate the records.

if

the validation fails that record needto restrictedto proceedto the OLTPtablefor data processing.

/******************************/

1.

Week endingMonth(ensure validmonth- 01- 12)

2.

Week EndingDay(ensure validday- 01- 31)

3.

Week EndingYear(ensure validyear- ensure valid number)

4.

Check IssueMonth(ensure validmonth- 01- 12)

5.

Check IssueDay(ensure validday- 01- 31)

6.

Check IssueYear(ensure valid number) MUST BE CURRENTYEAR(SYSTEMDATE)+- 30DAYSINTO PREVIOUSOR FUTUREYEAR

7.Location Job Phase Must match valid File60 Job

/******************************/

Fields which must be

numeric

1.

CheckDate

2.

CheckNo

3.

Check Amount

4.Issue

Date

/******************************/

check

for duplicate recordsin the CKTRANfile.(Current record = previous record)


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>