MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old November 19th, 2003, 07:27 AM
Hellmaster Hellmaster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 Hellmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question trigger

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

Reply With Quote
  #2  
Old November 19th, 2003, 07:30 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,401 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 h 31 m 39 sec
Reputation Power: 255
Can't you use a view?

Reply With Quote
  #3  
Old November 19th, 2003, 08:11 AM
Hellmaster Hellmaster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 Hellmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #4  
Old November 19th, 2003, 09:31 AM
Hellmaster Hellmaster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 Hellmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #5  
Old November 19th, 2003, 10:18 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,401 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 h 31 m 39 sec
Reputation Power: 255
You mean you tried a view? Why it didn't work?

Reply With Quote
  #6  
Old November 20th, 2003, 01:51 AM
Hellmaster Hellmaster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 Hellmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
HI

Im working with sharepoint team services and they work with webbots, and i dont know my webbots stuff.

Reply With Quote
  #7  
Old November 20th, 2003, 02:13 AM
Hellmaster Hellmaster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 Hellmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #8  
Old November 20th, 2003, 04:13 AM
Hellmaster Hellmaster is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 6 Hellmaster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
GOT it working now with the views and by using only 1 table


THX
Hellmaster

Reply With Quote
  #9  
Old November 20th, 2003, 05:09 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,401 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 h 31 m 39 sec
Reputation Power: 255

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > trigger


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway