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 |
|
cwfontan
Yak Posting Veteran
87 Posts |
Posted - 2010-04-07 : 11:18:22
|
I would like to show the conflict date in the error msg returned to my app. and as a bonus if I could short format it here would be great.. Declare @newEffective datetimeSelect @newEffective = effdate from insertedprint @countIF @count > 0 Begin RAISERROR 50009 'Effective date ' + CAST(@newEffDate, NVARCHAR(14)) + ' conflicts choose another effdate. ' ROLLBACK TRANSACTION RETURN endBegin |
|
|
cwfontan
Yak Posting Veteran
87 Posts |
Posted - 2010-04-07 : 11:23:31
|
| think i found the answer right after.. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67771 |
 |
|
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2010-04-07 : 11:28:19
|
| Just to start with:Declare @count intDeclare @newEffective datetimeSelect @newEffective = '2010-04-10'set @count = 10Declare @RetMsg varchar(1000)Set @RetMsg = 'Effective date ' + Convert(varchar,@newEffective,120) + ' conflicts choose another effdate. ' IF @count > 0 Begin RAISERROR (@RetMsg,16,1) ROLLBACK TRANSACTION RETURN end Regards,Bohra |
 |
|
|
|
|
|