You should have no problems doing this.  It is a very common practice to
even have a trigger call a sp that calls a sp that calls another, etc.
Make sure your permissions are set correctly and whenever you're in doubt
about what you're calling and where, write it out with the full
qualifications:   databaseA.dbo.sp_whatever
|-----------------+-------------------------------------------------------|
|Eric A. Laney    |"The only thing that wealth does for some people is to |
|Systems Engineer |make them worry about losing it."                      |
|LAN Optimization |                                                       |
|Team             |                                                       |
|Verizon Data     |                                    - Compte De Riverol|
|Services         |                                                       |
|Voice:           |                                                       |
|813.978.4404     |                                                       |
|Pager:           |                                                       |
|888.985.8519     |                                                       |
|-----------------+-------------------------------------------------------|





                                                                                       
                              
                    "Brad Comer"                                                       
                              
                    <bcomer@fusionproduc        To:     SQL <[EMAIL PROTECTED]>    
                              
                    tions.com>                  cc:                                    
                              
                                                Subject:     Trigger/SP ?              
                              
                    08/29/2001 11:55 AM                                                
                              
                    Please respond to                                                  
                              
                    sql                                                                
                              
                                                                                       
                              
                                                                                       
                              




Here is my situation, please give any advice. Thanks!

I have a MS SQL Server 2000 server that has on it 2 separate databases that
contain usernames & passwords for a single user. I need to know if I can
write a trigger that will call a sp on another database table? I know that
triggers can only be written on the tables within that db, which is true in
this case, because I will call the trigger when a update in tableA occurs,
the sp would be on tableB.

When a form is submitted that contains the updated username and password,
the trigger is called, that trigger calls a sp which takes the freshly
updated username & password and update the other databases table.

Any help is appreciated!

[EMAIL PROTECTED]
Brad

-----Original Message-----
From: Judith Taylor [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 24, 2001 5:47 PM
To: SQL
Subject: Re: ARG - Eliminating dups


Cameron,

You may have to apporach this differently...by breaking up your query into
two separate ones. As you've found, simply using the DISTINCT keyword will
still give you duplicates, because of the fact that the not all the data in
each column is exactly duplicated for each record. It would be different it
each field in a record was duplicated exactly.

<cfquery name="" datasource="">
        select DISTINCT email, PK
        from YourTable
</cfquery>
<cfset Key = query.PK>
<cfquery name="" datasource="">
         select fname, lname, rank,PK
          from YourTable
         WHERE PK = #Key#
</cfquery>

That might work....not super elegant, but hey...I'm not a 'super CF guru'
either ;)

Judith

Cameron Childress put into words:

>1) Eliminate rows containing duplicate email addresses.
>2) In case that a row is eliminated, the selected row should be the top
row
>when ordered in this fashion: "ORDER BY rank, lname, fname, pk".
>
>The valid result in this case would be the following set of data:
>"13,24,35,68"

Judith Taylor
ICQ: 67460562
Freelance ColdFusion Developer - Athens, OH

Friends don't let friends code before coffee.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to