Click here to Skip to main content
15,891,809 members
Home / Discussions / Database
   

Database

 
GeneralRe: Trouble Running Sql Script from Code Pin
Jeff Varszegi4-Nov-03 5:38
professionalJeff Varszegi4-Nov-03 5:38 
GeneralRe: Trouble Running Sql Script from Code Pin
perlmunger4-Nov-03 6:55
perlmunger4-Nov-03 6:55 
GeneralIdentity Seeds Pin
Colin Angus Mackay3-Nov-03 6:56
Colin Angus Mackay3-Nov-03 6:56 
GeneralHandling Disconnected Data In ADO.NET Pin
L Thomas3-Nov-03 5:10
L Thomas3-Nov-03 5:10 
Generalsql tables Pin
ranjjj31-Oct-03 3:14
ranjjj31-Oct-03 3:14 
GeneralRe: sql tables Pin
ranjjj31-Oct-03 3:18
ranjjj31-Oct-03 3:18 
GeneralDublication of rows Pin
Vaibhav Sanghavi30-Oct-03 22:15
Vaibhav Sanghavi30-Oct-03 22:15 
GeneralRe: Dublication of rows Pin
Rahul Walavalkar3-Nov-03 2:54
Rahul Walavalkar3-Nov-03 2:54 
Hi Vaibhav,

Question 1: What would be the matching details of a particular hotel, which would help us to determine, whether the two records submitted by the two providers are of the same hotel?


Question 2: How can you be sure, that the hotel "Inter" sent by Provider A is the same as the hotel "InterCon" submitted by Provider B. If the address of "Intercon" is the same as that of "Inter", except for an extra comma, how can you determine that both the records are of the same hotel, programmatically?


Question 3: What is/are the field/s that is/are common and unchangeable for both the records?

As fas as your question goes.

If we assume that only the id changes, and the rest of the details remain the same, then you can design the database this way..

tblHotel<br />
----------<br />
HOTEL_ID (pk) (IDENTITY)<br />
HOTEL_NAME<br />
HOTEL_ADDRESS<br />
and so on for the unchanging fields.<br />
<br />
-----------


another table would be there,

tblProviderHotel<br />
-------------<br />
PROVIDER_HOTEL_ID (pk) identity (just a key field)<br />
HOTEL_ID (fk from tblHotel)<br />
PROVIDER_HOTEL_ID (this would be the id, given by the providers, "inter", "intercon" etc)<br />
PROVIDER_ID (fk from Provider table if you want)<br />
-------------


Now in this scenario (inter and intercon scenario), tblHotel would contain just one record for the hotel details, whereas the tblProviderHotel would contain two records with the same HOTEL_ID (from tblHotel) but different PROVIDER_HOTEL_IDs (inter and intercon)

Similarly, if a provider C sends you a record of the same hotel, but the id is differnt, say "Inter-Conti", then you can check if the rest of the fields such as HOTEL_ADDRESS, CITY, ZIP etc matches with any record in tblHotel and if it does as in thsi case, then take the HOTEL_ID for the matching record from the tblHotel and just make a new entry in the tblHotelProvider table, with the id that the provider gave you..

So now, you have 1 record in tblHotel, but 3 related records in tblHotelProvider all pointing to one hotel, but submitted by different providers..


Also this is implemented, assuming all the other details are matching for all the 3 hotel records provided by the providers..as I asked you earlier.

Please do let me know if this helps..

Cheers,
Rahul

I do not understand what I do. For what I want to do I do not do, but what I hate I do. - Romans 7:15
GeneralRe: Dublication of rows Pin
Vaibhav Sanghavi3-Nov-03 3:10
Vaibhav Sanghavi3-Nov-03 3:10 
GeneralSystem.Data.Sqlclient.TdsParser Pin
yyf30-Oct-03 9:27
yyf30-Oct-03 9:27 
GeneralConnectionString.Timeout Pin
yyf30-Oct-03 8:06
yyf30-Oct-03 8:06 
Generalsimple sample of ADO + Access + VC++ Pin
slomoman30-Oct-03 7:12
slomoman30-Oct-03 7:12 
Generaldate Pin
Anonymous30-Oct-03 6:30
Anonymous30-Oct-03 6:30 
GeneralRe: date Pin
andyharman3-Nov-03 11:26
professionalandyharman3-Nov-03 11:26 
GeneralIDbCommand.CommandTimeOut Pin
yyf30-Oct-03 4:21
yyf30-Oct-03 4:21 
GeneralRe: IDbCommand.CommandTimeOut Pin
Mike Dimmick30-Oct-03 4:59
Mike Dimmick30-Oct-03 4:59 
GeneralRe: IDbCommand.CommandTimeOut Pin
yyf30-Oct-03 8:07
yyf30-Oct-03 8:07 
QuestionProblem in connection string??? Pin
d meenakshi29-Oct-03 18:53
d meenakshi29-Oct-03 18:53 
GeneralRows Pin
Anonymous29-Oct-03 9:17
Anonymous29-Oct-03 9:17 
GeneralUpdate and select in same procedure with a dataadapter Pin
MrDanJordan29-Oct-03 5:49
MrDanJordan29-Oct-03 5:49 
GeneralHelp, why sql server is pending..... Pin
yyf29-Oct-03 4:09
yyf29-Oct-03 4:09 
GeneralRe: Help, why sql server is pending..... Pin
Jeff Varszegi3-Nov-03 15:07
professionalJeff Varszegi3-Nov-03 15:07 
Generalabout connection pooling Pin
yyf28-Oct-03 10:12
yyf28-Oct-03 10:12 
QuestionThe functions in ADO.NET are asynchronism or synchronism? Pin
yyf28-Oct-03 9:14
yyf28-Oct-03 9:14 
GeneralDebugging a Stored Proc Pin
Dave S28-Oct-03 3:10
Dave S28-Oct-03 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.