Article View: comp.databases.ms-sqlserver
Article #143trigger question for the gurus
From: Tom
Date: Mon, 28 Sep 1998 00:00
Date: Mon, 28 Sep 1998 00:00
39 lines
2393 bytes
2393 bytes
I have two tables. One that looks like a normal table we will call it A
has rows and one that looks like a metadata table (called B) which has the
rows transposed to columns.
What I want to be able to do is update table B when ever table A is
Inserted,updated or deleted from. My problem is that in table B it is not
in a row format but a column format. I need to capture the column name that
was changed updated or deleted and do the same in column B. I will need to
do this for each column that is update inserted or deleted from the row in
column A. Table C stores the names of the columns to update Table B and is
joined on column_id.
Any sample code would be a great help thanks
Example
TABLE : A
Column Names: Name address city
state
Values for columns: Jim somewhere Beverly Hills CA
Table: B
Column Name: Column_id value
1 Jim
2 Somewhere
3 Beverly hills
4 CA
TABLE C : column_id name
1 Name
2 Address
3 City
4 State
Thanks
Tom
Technical Details
Message-ID:
<360fcb52.0@news.one.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff490,9e2326f14a16e1f6,start X-Google-Attributes: gidff490,public X-Google-Thread: 104de1,9e2326f14a16e1f6,start X-Google-Attributes: gid104de1,public X-Google-Thread: 10bbfe,9e2326f14a16e1f6,start X-Google-Attributes: gid10bbfe,public X-Google-Thread: 11301e,9e2326f14a16e1f6,start X-Google-Attributes: gid11301e,public From: "Tom" <somewhere@nospam.com> Subject: trigger question for the gurus Date: 1998/09/28 Message-ID: <360fcb52.0@news.one.net> X-Deja-AN: 395694191 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 X-Trace: 28 Sep 1998 13:45:54 -0500, 206.112.208.67 X-Authenticated-User: schraer Organization: OneNet Communications News Hub Newsgroups: comp.databases.ms-sqlserver,cz.comp.microsoft.sql,microsoft.public.sqlserver.datawarehouse,microsoft.public.sqlserver.programming