Advertisement

10.04.2008 at 08:28AM PDT, ID: 23787448 | Points: 250
[x]
Attachment Details

Create Trigger

Asked by dba_raf_dba in MS SQL Server, SQL Server 2005

hi,
I've these tables:

CREATE TABLE TAB1
(
  ID  VARCHAR2(64),
  NAME VARCHAR2(64)
)

ID...............NAME
1................AAA;2;BBBB;4;FFFFF;3;RRRRR;2;
3................AAA;2;CCC;2;DDD;3;
6...............TTTT;3;NNNN;5;
...............................
.............................. more 100 rows


CREATE TABLE TAB2
(
  COD_ID  VARCHAR2(64),
  NAME_TYPE VARCHAR2(64)
)

I'd like to create a trigger on TAB1 that when I insert a new record into TAB1 I get these records into TAB2:

COD_ID................NAME
1....................AAA
1....................AAA -- 2 records with AAA (AAA;2)
1....................BBBB
1....................BBBB
1....................BBBB
1....................BBBB -- 4 records with BBBB (BBBB;4)
1....................FFFFF
1....................FFFFF
1....................FFFFF -- 3 records with FFFFF (FFFFF;3)
1....................RRRRR
1....................RRRRR -- 2 records with RRRRR (RRRRR;2)

3....................AAA
3....................AAA
3....................CCC
3....................CCC
3....................DDD
3....................DDD
3....................DDD

6....................TTTT
6....................TTTT
6....................TTTT
6....................NNNN
6....................NNNN
6....................NNNN
6....................NNNN
6....................NNNN
.............................
...............................

How can I create this trigger to get my output?

Thanks in advance!Start Free Trial
[+][-]10.04.2008 at 11:09PM PDT, ID: 22643570

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.

 
[+][-]10.04.2008 at 11:12PM PDT, ID: 22643577

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.

 
[+][-]10.05.2008 at 12:34AM PDT, ID: 22643713

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.

 
[+][-]10.05.2008 at 01:22AM PDT, ID: 22643773

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.

 
[+][-]10.05.2008 at 03:28AM PDT, ID: 22643959

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.

 
[+][-]10.05.2008 at 03:35AM PDT, ID: 22643973

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.

 
[+][-]10.05.2008 at 05:01AM PDT, ID: 22644172

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.

 
[+][-]10.05.2008 at 05:04AM PDT, ID: 22644187

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.

 
[+][-]10.05.2008 at 06:35AM PDT, ID: 22644437

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.

 
[+][-]10.05.2008 at 06:49AM PDT, ID: 22644485

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.

 
[+][-]10.05.2008 at 07:02AM PDT, ID: 22644526

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.

 
 
Loading Advertisement...
20081112-EE-VQP-42 / EE_QW_2_20070628