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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-04-22 : 21:55:12
|
Jamin writes "Dear Guru SQL Team I have three tables “Table1” and “Table2” “Table3” In side theses tables, I have 4 columns, one column auto puts in a number listing, what I need to happen is each time I insert data into table1, the data in my Webkey column of table1 will be the same as in the Webid column in table2 I did this with a trigger that looks like this…
CREATE TRIGGER [trig1] ON dbo.Table1 FOR INSERT AS INSERT INTO table2 (webid) SELECT webkey FROM inserted
So now I need to make it so when I update a row in table1 it will change the row in table2 and when I delete a row out of table1 it delete the row out of table2
I tried to make a update trigger with no luck it keeps changing the full column Any ideas? Also I mentioned 3 tables, it is because there is a column in that row that needs to act the same as table2. my over all goal is to be able to edit any of the three tables and the changes move to the other tables, but there be different data in the tables that I don’t want moving around. The different data though are not in the webkey/id columns I am using them columns as a user input ID number
Student of SQL Jamin" |
|
|
|
|
|