By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,364 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,364 IT Pros & Developers. It's quick & easy.

Stored Procedure Problem

P: 4
Im having two databases in these two databases containing same tables and stored procedures
In that while execting one of the stored procedures in both databases getting different records
I want records of data which are not in another database
Thanks in advance
Mar 18 '08 #1
Share this Question
Share on Google+
2 Replies


amitpatel66
Expert 100+
P: 2,367
Im having two databases in these two databases containing same tables and stored procedures
In that while execting one of the stored procedures in both databases getting different records
I want records of data which are not in another database
Thanks in advance
Create a dblink to another database
then try this query:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT * from table1 WHERE column1 NOT IN (SELECT * FROM table1@dbase2)
  3.  
  4.  
Mar 18 '08 #2

ck9663
Expert 2.5K+
P: 2,878
Use a fullname to refer to your table

SELECT * FROM db1..table1 WHERE column1 NOT IN (SELECT * FROM db2..table1)

-- CK
Mar 19 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.