|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi
Sorry to bother u with most likely a stupid question but im new to sql. This is my problem I want to copy certain collums from table1 to table2. I only want to copy them when this collum in table1tp_goedgekeurd_x003f_ has the value ja The names of the collums are the same in table1 and table2. This is what i have. CREATE TRIGGER test_update_aanvraag ON dbo.ows_Project2_u_AanvraagAFDAlgemenezaken FOR UPDATE IF UPDATE (tp_goedgekeurd_x003f_) == "ja" im doing this acces THX Hellmaster |
|
#2
|
||||
|
||||
|
Can't you use a view?
|
|
#3
|
|||
|
|||
|
hi
I tried that but i couldent get it to work. this is used with sharepoint team sevices on a intranet Last edited by Hellmaster : November 19th, 2003 at 09:04 AM. |
|
#4
|
|||
|
|||
|
OK
its working partially He copys the data between the tables but he also copys the data he did before so he copys them twice and thus gives me double records in the db How can i make him check so he doesen copy double items or somethin like that. this is what i have now INSERT INTO ows_Project2_u_Vrijedagenoverzicht (tp_Title, tp_Modified, tp_Created, tp_Author, tp_Editor, tp_Version, tp_EventDate, tp_EndDate) SELECT tp_Title, tp_Modified, tp_Created, tp_Author, tp_Editor, tp_Version, tp_EventDate, tp_EndDate FROM ows_Project2_u_AanvraagAFDAlgemenezaken WHERE (tp_Goedgekeurd_x003f_ = N'ja') THX Hellmaster |
|
#5
|
||||
|
||||
|
You mean you tried a view? Why it didn't work?
|
|
#6
|
|||
|
|||
|
HI
Im working with sharepoint team services and they work with webbots, and i dont know my webbots stuff. |
|
#7
|
|||
|
|||
|
This is what i have now but now he doesent copy anything anymore ?
ALTER TRIGGER test_aanvraag_update ON dbo.ows_Project2_u_AanvraagAFDAlgemenezaken FOR UPDATE AS INSERT INTO ows_Project2_u_Vrijedagenoverzicht (tp_Title, tp_Modified, tp_Created, tp_Author, tp_Editor, tp_Version, tp_EventDate, tp_EndDate, tp_ID) SELECT tp_Title, tp_Modified, tp_Created, tp_Author, tp_Editor, tp_Version, tp_EventDate, tp_EndDate, tp_ID FROM ows_Project2_u_AanvraagAFDAlgemenezaken WHERE (tp_Goedgekeurd_x003f_ = N'ja') AND (tp_ID) NOT IN (select tp_ID FROM ows_Project2_u_Vrijedagenoverzicht) Hellmaster |
|
#8
|
|||
|
|||
|
GOT it working now with the views and by using only 1 table
THX Hellmaster |
|
#9
|
||||
|
||||
![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > trigger |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|