Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Query trigger question

Status
Not open for further replies.

j252ewv

Programmer
Jul 2, 2008
43
GB
Hope someone can help

I have a table and on it i have an update trigger, when i update a single row all works well.
If i issue a query such as update table set name = 'Daren' i get the error - Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Does anyone know a way round this issue?
 
Your trigger isn't written to handle multi-row updates. Post the trigger code here so the forum members can see it and make suggestions.
 
the workaround is to rewrite your trigger to not use subqueries or a values clause in an insert.

"NOTHING is more important in a database than integrity." ESquared
 
I found another posting by SQL Sister who seems to reall you her stuff, and followed her advice

the thread elaborates on NOT using sub queries etc. and works perfectly

I will post the link here shortly

SQLSister again fixes the problem.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top