Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two table:
1)profile:
prof_id
name
address
emailid
log_id

2)login:
log_id
username
password

when I delete data from profile table ,data in login table also deleted .
what is sql query in store procedure for that????????

please help me........
Posted
Updated 24-Dec-12 4:03am
v2
Comments
Herman<T>.Instance 24-Dec-12 10:15am    
what have you tried? You earlier asked for some kind of stored procedure with the same table structure. Get to work by using google for instance, don't ask us to do your work.

I think store procedure is not took a part in such workflow.
Obviously the reason is hidden in relationships between this tables.
Profile table is major , login is dependant.
Whenever you try to delete data from profile table with help of such query:
delete from profile where name='testuser';

all the data from login table which is related to profile will be deleted too.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900