|
-
Emailing from DOS
Hi,
What are the steps or code required for creating a email script in DOS. I.e, there are SQL codes to be run using BCP utility and SQLCMD in DOS and if anyone of the code fails a message should be automatically sent to a mail id and if the code run successfully a success message should be sent to the same mail id.
Thanks,
Saran.
-
You can call msdb..sp_send_dbmail as long as you enabled db mail on sql server.
-
Error handling in SQL Server
Thank u. How can we check errors in sql. I tried doing the below:
begin try
begin transaction
execute........
commit transaction
end try
begin catch
select error_message();
end catch;
But it threw only errors like if a column is defined as not null and while inserting values into table, if that particular column is given null it threw error. But it does not check for anything else. If the data type is smalldatetime and date format while inserting is something else it did not throw error. The code show throw all the possible errors present in a script. How do we get it? Is it possible?
Thanks,
Saran.
-
-
Is it possible to post the exact sql that you are running and an example that can be recreated to show your problem? I think that would help with troubleshooting your problem a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|