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 |
|
upani
Starting Member
12 Posts |
Posted - 2010-04-29 : 23:46:06
|
| Hi,I write a java programming that when exception occurs, it will call the responsible trigger'noticesEx:create trigger on tableA for insertif(abcd...)begin print('aaaaa')rollback transactionendif(xyz....)beginprint('bbbbbb')rollback transactionelseprint('ccccccccc')rollback transactionSo how can i select notice 'aaaaa','bbbbb', or 'ccccc' of that trigger when incorrect insertion occurs?And i have another question is how to create trigger that check the data i want to insert is which type? Char or datetime....?Please show me,Thanks! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-30 : 01:43:33
|
| you mean you need help on logic which raises error messages?for datatype check, you need make column as varchar and then do check using functions like ISDATE(),ISNUMERIC() etc and raise appropriate errors------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
upani
Starting Member
12 Posts |
Posted - 2010-04-30 : 02:27:35
|
| Yes! Can you help me?Thank you! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-30 : 02:39:42
|
| what according to you is incorrect insertion?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|