….sql code goes here which will cause error.
--To check for error, we use @@error global variable predefined in sql.
set @error = @@error
if @error <> 0
exec sp_altermessage @error ,'with_log', 'true'
To view the error, you can either view either in
- windows event viewer
- SQL server Mgmt studio , path is :
--> Management --> Sql Server Logs - exec master..xp_readerrorlog
http://www.sqlservercentral.com/articles/Error+Description/65013/
Regards
1 comment:
i like your work!!!
Post a Comment