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.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 sql error handling in report

Author  Topic 

ssdeveloper
Starting Member

37 Posts

Posted - 2011-09-08 : 08:56:37
Hi Everyone,

I have this strange situation which I was trying to work around from many days. I have this column with rows entered as string and I was trying to derive a date out of it.

Ex: 'lm_na_app_06_08_2010' and substring the date and convert it to dateformat and then use it in some other calculation used as a filter. But the people who put this data in, were not consistent with the dates in the string and there are several issues which could not convert the date part and thus stops the proc.

And this proc will be used in the report which takes the tag like mentioned above in example as a parameter. I want to try and catch the error and display the customised message in the report so that the user knows it s the fault with the date in the tag.

How can we put the catch thing in the proc if I know the sql server error message as Msg.241.....

I think I should use RAISERROR for the custom message but I didn't use the whole try-catch and raiserror before, can anyone help me with the syntax?

Thanks in advance

ssdeveloper
Starting Member

37 Posts

Posted - 2011-09-08 : 14:38:25
I am sorry I think this is complicated, but do you need any more info from me? I didn't get any replies!
Go to Top of Page
   

- Advertisement -