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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-12-08 : 08:09:22
|
| Hemant writes "my database contains table1in this table1 there are two fields ap as tinyintst as char(3)i want to creat a trigger if st <> 'cls'so ap = 0elseso ap = 1please help me" |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-12-08 : 08:25:38
|
| You need to use the pk on the tablecreate trigger tr on table1asupdate table1set ap = case when i.st <> 'cls' then 0 else 1 endfrom inserted iwhere i.pk = table1.pk==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|