Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Help with code

Author  Topic 

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-03-02 : 08:15:17
removed

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-03-02 : 08:25:02
u will get the results which are present in prod and not in uat table
try this if ur requirement is this
select col1,required columns.....
from chase.dbo.var_program_store_rel PROD left join uat_chase.dbo.var_program_store_rel UAT
on PROD.var_id = UAT.var_id
and PROD.program_id = uat.program_id
where
UAT.var_id IS NULL
and uat.program_id IS NULL
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-03-02 : 08:26:49
select uat.*
from chase.dbo.var_program_store_rel PROD right outer join uat_chase.dbo.var_program_store_rel UAT
on PROD.var_id = UAT.var_id
and PROD.program_id = uat.program_id
and not exists(select * from var_program where var_id=UAT.var_id and program_id = uat.program_id)



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 10:12:59
what you need is staements like below for each of tables

INSERT INTO chase.dbo.merc_landing_subcategory (column names....)
SELECT u.columnnames... FROM [UAT_Chase].dbo.cstore_category u
LEFT JOIN chase.dbo.merc_landing_subcategory c
ON c.var_id =u.var_id
and c.program_id =u.program_id
WHERE c.var_id IS NULL
and c.program_id IS NULL


similarly for each other table
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-03-02 : 10:36:20
replace table names wityh var_program and columns with its columns
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-22 : 13:02:04
Why do you have removed your original post?



No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-22 : 13:03:03
quote:
Originally posted by sgandhi

removed


why did you do this? dont remove your original questions please. somebody might benefit out of this whole discussion.
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-06-22 : 13:08:00
I had information in there which i should not have posted
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-22 : 13:10:11
quote:
Originally posted by sgandhi

I had information in there which i should not have posted


then you should have removed only that portion. why remove entire post? also if information is so sensitive why post it. you can always simulate your scenario using mock data and post it
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-06-22 : 13:11:03
So was there no way to modify your post a little bit?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

sgandhi
Posting Yak Master

115 Posts

Posted - 2009-06-22 : 13:11:11
yes when i orginally posted it, i was new, didnt know that. Now i do. Ok wont remove others. Thanks
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-23 : 02:28:13
quote:
Originally posted by sgandhi

I had information in there which i should not have posted


Ok. What about the answers given?
Didn't they have any information from your original post?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -