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 2000 Forums
 SQL Server Development (2000)
 Sql

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2008-08-06 : 13:41:07
I am new to triggers...
I need a help to write a trigger during insert/update of the records the data in the table..

Ex:
select
case WHEN (col1 = '14' OR col1= '1') then '1' else '0' end as 'Col1'
from table..

Thanks for your help in advance !!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-06 : 14:09:56
Is nt it better to do this in place where you populate the value for col1 field? can you explain how you're populating values?
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2008-08-06 : 14:28:35
Visakh !! ignore my select query..
I want to update the values for the column in the table..

From the front end application during the insert or updates the data was being store for Col1 with 14 instead it should be 1.

Instead of correcting the code in the front end.
I want to do it from the backend when insert or update transaction happend..

Please suggest me..

Let me know if i am not clear with my explaination...


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-06 : 14:33:30
Why can't you do this in the frontend since triggers aren't recommended?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2008-08-06 : 14:39:50
Since we don't want to send the application upgrades.
So that it can corrected through T-sql.

It can be corrected in front end for the future release. In release trigger will be disable..


Go to Top of Page
   

- Advertisement -