How can I use values returned from one query in another query?
What I want to do is insert values returned from one query into another
table.
I'm still learning how to write T-SQL SP using MS SQL Server 2000.

SELECT A.AffiliateID, dbo.B.RateCodeID
FROM   dbo.tbl_affiliates A 
INNER JOIN dbo.tbl_affiliates_ratecodes B ON A.AffiliateID = B.AffiliateID
WHERE (A.ReferringDomain = '@referringdomain')  AND (B.RateCode =
'@ratecode')

SET @verify = @@rowcount

/* insert an entry into the referrer log if the domain has been verified. */
IF @verify > 0
        BEGIN
                INSERT INTO dbo.tbl_affiliates_log (AffiliateID, RateCodeID)

                VALUES (@??????,@??????)
        END
END


Thanks,
Dave Bosky




HTC Disclaimer:  The information contained in this message may be privileged and 
confidential and protected from disclosure. If the reader of this message is not the 
intended recipient, or an employee or agent responsible for delivering this message to 
the intended recipient, you are hereby notified that any dissemination, distribution 
or copying of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by replying to the message and 
deleting it from your computer.  Thank you.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=6
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=6

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                        

Reply via email to