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.
Author |
Topic |
v890115
Starting Member
1 Post |
Posted - 2008-11-12 : 15:16:50
|
Hi everyone,Not sure if this is the right forum to ask my question. MODs, if not please move this thread to the correct forum. Apologize and thanks!I am new to SQL. I have a SQL job that I run monthly. This job will go and grab required data from the tables and export the data to a text file. I need help on adding a function to the script to detect if a table or field is NULL (Blank). If a field is NULL/ Blank I want it will stop and send me an alert message.Not sure if I am making myself clear on here. But really appreciate if you can help.Thanks in advance |
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2008-11-12 : 19:30:40
|
Probably the simplest way to do this is create a staging table with "NOT NULL" defined for the fields you don't want to allow nulls in. The job will fail if it hits one of those and you can have it email you. If it's all clean the data will load no problem and then dump your stage table out to a text file.Mike"oh, that monkey is going to pay" |
 |
|
|
|
|