Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Help needed


Help needed

Author
Message
abinash.mishra84
abinash.mishra84
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 9
Hi Gurus,

I am new to SQL server world. I need your valuable suggestion and help to have an approach for the below scenario.

Details on tables and requirement attached herwith. I am also trying from my end to rectify the query.

My requirement-:

IF coulmn ICP is present in [R33HypInfa].[dbo].[DF012_Look_up_hfm] table then check for the columns Custom1,Custom2,Custom3. if any of these three columns have valid data then populate them else populate none.

to check for the valid data we need to compare [R33HypInfa].[dbo].[DF012_HFM_Staging] table to [R33HypInfa].[dbo].[DF012_Look_up_hfm] and if custom1 of these two tables are not same then we need to further do a look up on [R33HypInfa].[dbo].[DF012_Look_up_hfm] for custom1 and [R33HypInfa].[dbo].[DF012_Look_up_hfm] for custom2 column.

The column custom1 will be further looked up in a look up table called "[R33HypInfa].[dbo].[DF012_LKP_COMPARE_C1]" If present then valid in the staging table else invalid.

The column custom2 will be further looked up in a look up table called "[R33HypInfa].[dbo].[DF012_LKP_COMPARE_C2]" If present then valid in the staging table else invalid.


IF ICP is present then the value of ICP needs to be look up in [R33HypInfa].[[dbo].[DF012_C3_Class] table for custom3 column. then the value in custom3 will be populated in ICP column and custom3 will be none.

[highlight=#ffff11]Attached below is excel sheet has table and all data information. [/highlight]

Please help!!!!

Tables-:
1.[R33HypInfa].[dbo].[DF012_HFM_Staging]
2.[R33HypInfa].[dbo].[DF012_Look_up_hfm]
3. [R33HypInfa].[[dbo].[DF012_C3_Class]
4.[R33HypInfa].[dbo].[DF012_LKP_COMPARE_C1]
5.[R33HypInfa].[dbo].[DF012_LKP_COMPARE_C2]
vinu512
vinu512
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1155 Visits: 1618
Hi Abinash, Welcome to SSC.

Its a good start, but this is not how you post a question in an online forum. Its near impossible to understand your requirement....just by reading your explanation. We can't see your problem from here until you post some readily consumable sample data. Attaching excel files is not considered readily consumable sample data. People here are working and take some time off their busy schedules to answer these questions, so nobody would have the time to download your excel files and then provide a solution.

Please have a look at the link in my signature. It has all the information you need to get your problem solved quickly.

Please post DDL of the tables, readily consumable sample data as a batch of Insert statements......an then post the requirement. If you do the above mentioned things then I am sure that someone would come up with a very quick....working....and tested solution to your requirement.

Vinu Vijayan

For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden ;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search