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 |
|
josh2009
Yak Posting Veteran
81 Posts |
Posted - 2009-09-15 : 11:53:38
|
| Hi,Trying to validate user entry for certain fields in a purchased application. I've tried using sp_addmessage in my trigger to try and show a message for the users if they forget to enter a doctor's name. My trigger is as follows -USE [Test]GO/****** Object: Trigger [dbo].[BLGH_TR_Event_Cath] Script Date: 09/11/2009 15:56:27 ******/EXEC sp_addmessage 50002, 16, N'Interventional MD expects a value. Please enter a physician name.';GOSET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOIF OBJECT_ID ('BLGH_TR_Event_Cath,'TR') IS NOT NULL DROP TRIGGER BLGH_TR_Event_Cath;GOCREATE TRIGGER [dbo].[BLGH_TR_Event_Cath]ON [dbo].[Event_Cath]AFTER INSERT, UPDATEASDeclare @SSEventCathID int, @CathAttending2nd varchar(40)Select @SSEventCathID = Event_Cath.SS_Event_Cath_ID, @CathAttending2nd = Event_Cath.CathAttending2ndFrom Event_Cath, InsertedWhere Event_Cath.SS_Event_Cath_ID = Inserted.SS_Event_Cath_ID/* Check @CathAttending2nd */BeginIf Inserted.CathAttending2nd = ' ' RAISERROR(50001,1,16) EndAny help would be greatly appreciated. Thanks |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-09-16 : 12:48:14
|
| most of front end tools have ability to do client side validations. which is tool you're using? |
 |
|
|
|
|
|