Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

i have develop a Job Portal Web site.

i have 2 tables

User_Document
UserID ----------DocID ----- CVTitle
1 --------------1 --------my dotnet
1 --------------2 --------my sharepointcv
1 --------------3 --------my javacv

and other table is

UserJob

UserID-------------DocID-------------JobID------------AppliedDate
1 --------------1-----------------3---------------22/10/2013
1 --------------2-----------------4---------------22/10/2013
1 --------------3-----------------5---------------22/10/2013
how to delete 1 record
tell me plz
Posted
Comments
ZurdoDev 10-Oct-13 15:53pm    
DELETE FROM table1 WHERE ...
DELETE FROM table2 WHERE ...

Where are you stuck?

1 solution

if u want to delete from User_Document table record cannot be deleted until and unless you remove its primary key from UserJob table.

if that's not the case then the query is pretty much simple

delete from User_Document where UserID = 1
delete from UserJob where UserID = 1
 
Share this answer
 
Comments
paracha1 12-Oct-13 15:12pm    
Heloo Ainy Mughal

thanks to give some idea
but dear
i want to delete on cv on User_document
when i delete this the record the message displayed this id is other table as forign key
when i delete the 1 cv of U_Doc table the UserJob delete record aginst is id. how can we write query.
plz tell me some sulution plz Ainy brother i m much worried about this

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