Advertisement

04.08.2008 at 11:12AM PDT, ID: 23305696
[x]
Attachment Details

Returning multiple records from a SELECT statement inside a trigger

Asked by manduz_griffus in SQL Query Syntax, Databases Miscellaneous, SQL Server 2005

Tags: Microsoft, SqQL Serve, 2005

Hi, im currently having a problem regarding triggers. I have a table in which whenver i insert/update records in it, i want a trigger to be fired that does:

Get the record(s) related to the inserted/updated row from another table and copy it in another.

My problem is i don't know how to loop to all the records returned by the select statement so I can retrieve the row IDs. I need to insert these IDs in another table via this trigger. Im not sure if looping is the best way, but I dont have any ideas. Any suggestions?Start Free Trial
 
Loading Advertisement...
 
[+][-]04.08.2008 at 11:15AM PDT, ID: 21307971

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 11:51AM PDT, ID: 21308375

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 12:02PM PDT, ID: 21308477

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: SQL Query Syntax, Databases Miscellaneous, SQL Server 2005
Tags: Microsoft, SqQL Serve, 2005
Sign Up Now!
Solution Provided By: chapmandew
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.08.2008 at 06:18PM PDT, ID: 21311126

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.08.2008 at 06:21PM PDT, ID: 21311136

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.30.2008 at 07:32PM PDT, ID: 21476184

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 04:21PM PDT, ID: 21536999

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628