about relational database

Posted by Abhi_patil under Sql Server on 5/22/2009 | Views : 1099 | Status : [Member] | Replies : 2
in my project i have used around 50 database tables, there is no relation between these tables but we maintains that relation while writing query, that means suppose table1 have column 'pkUserId' and we taken table2 column 'fkUserId' but there is no relation made at time of design. now when we want to delete any user then we have to separately delete from both table.

Now i have to maintain relation betwwen tables please suggest...
ThankU.




Responses

Posted by: Muhsinathk on: 6/30/2012 [Member] Bronze | Points: 25

Up
0
Down
please alter the two tables with primary key and foreign key

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 5/25/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Abhi_patil

It is Difficult to comment on your problem, but someone needs to sit down and do the redisign on the Database, a non relational database in an application is a night mare :). There is always a work aroun d this , but its not considered a good proactice. Some people who uses database like you, they use indexes triggers to maintain the relations, but it becomes a problem when the Application that uses those database changes , because you have to go through all the table, and its not easy to see which table is related to which one. Unforfutately until you create proper relatins between your tables you will have to Update or Delete records from both tables and that means your stored procedures are doing more extra work and in that case i dont see why not your application might not be slow.

Thank you for Posting at dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Abhi_patil, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response