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 |
|
tvb2727
Starting Member
35 Posts |
Posted - 2010-10-16 : 20:46:12
|
| I need to pull data from the table to use in a trigger. How can I run an select statement in a trigger and put the data in a variable? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-17 : 02:37:15
|
| please keep in mind that select might return more than single value in which case you wont be able to store it in a variable. You can never assume that trigger will only process one record at a time. So you may be better off using a table variable instead of normal variable------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-17 : 02:37:47
|
| please keep in mind that select might return more than single value in which case you wont be able to store it in a variable. You can never assume that trigger will only process one record at a time. So you may be better off using a table variable instead of normal variable------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|