Click here to Skip to main content
15,918,193 members
Home / Discussions / Database
   

Database

 
AnswerRe: Problem with distributed transaction Pin
Pete O'Hanlon24-Nov-06 2:18
mvePete O'Hanlon24-Nov-06 2:18 
GeneralRe: Problem with distributed transaction Pin
MasudM24-Nov-06 3:12
MasudM24-Nov-06 3:12 
QuestionDelete Pin
aaraaayen23-Nov-06 0:34
aaraaayen23-Nov-06 0:34 
AnswerRe: Delete Pin
Pete O'Hanlon23-Nov-06 1:40
mvePete O'Hanlon23-Nov-06 1:40 
GeneralRe: Delete Pin
Russell Jones23-Nov-06 4:42
Russell Jones23-Nov-06 4:42 
GeneralRe: Delete Pin
i.j.russell24-Nov-06 9:35
i.j.russell24-Nov-06 9:35 
AnswerRe: Delete Pin
albCode23-Nov-06 5:19
albCode23-Nov-06 5:19 
AnswerRe: Delete Pin
Ritwik Sanyal26-Nov-06 23:36
Ritwik Sanyal26-Nov-06 23:36 
If you are using SQL Server you can write a FOR DELETE trigger on the table 'contact'. Try this: -
--------------------------------------------------------------------------------------------------
CREATE PROCEDURE DeleteContact @consultantid int
AS
DELETE FROM contact WHERE consultantid=@consultantid

--------------------------------------------------------------------------------------------------
Now create a trigger on the table 'contact': -
--------------------------------------------------------------------------------------------------
CREATE TRIGGER DeleteAddress ON contact
FOR DELETE
AS
CREATE TABLE #DeletedContacts
(
consultantid int
)
INSERT INTO #DeletedContacts SELECT consultantid FROM deleted
DELETE FROM address WHERE consultantid IN (SELECT consultantid FROM deleted)

--------------------------------------------------------------------------------------------------
Now, you execute the stored procedure: EXEC DeleteContact <anyconsultantid>
After it deletes from the table 'contact' the trigger will be excuted and it will delete corresponsing rows from the table 'address'.

I am a Software Developer using C# on ASP.NET.

QuestionSql Server 2005 - Administration - Full Text [modified] Pin
gandalf_le_blanc22-Nov-06 22:25
gandalf_le_blanc22-Nov-06 22:25 
Questionre:table creation n sql & Triggers Pin
rrrriiizz22-Nov-06 21:51
rrrriiizz22-Nov-06 21:51 
AnswerRe: re:table creation n sql & Triggers Pin
Colin Angus Mackay23-Nov-06 0:28
Colin Angus Mackay23-Nov-06 0:28 
QuestionUPDATE Pin
thathvamsi22-Nov-06 21:13
thathvamsi22-Nov-06 21:13 
AnswerRe: UPDATE Pin
G.Meena24-Nov-06 1:34
G.Meena24-Nov-06 1:34 
QuestionSend Null value to stored procedure with old ASP Pin
web12master22-Nov-06 21:11
web12master22-Nov-06 21:11 
Questionhow can i build an interface to my database Pin
undercharm22-Nov-06 20:38
undercharm22-Nov-06 20:38 
AnswerRe: how can i build an interface to my database Pin
Colin Angus Mackay23-Nov-06 0:26
Colin Angus Mackay23-Nov-06 0:26 
QuestionExporting Tables From OneDatabase To another Database Pin
Laji5922-Nov-06 18:44
Laji5922-Nov-06 18:44 
AnswerRe: Exporting Tables From OneDatabase To another Database Pin
Pete O'Hanlon23-Nov-06 4:12
mvePete O'Hanlon23-Nov-06 4:12 
QuestionHow to filter this kind of data ? Pin
cheeken2u22-Nov-06 18:26
cheeken2u22-Nov-06 18:26 
AnswerRe: How to filter this kind of data ? Pin
Anshuman Singh22-Nov-06 18:48
Anshuman Singh22-Nov-06 18:48 
GeneralRe: How to filter this kind of data ? Pin
cheeken2u22-Nov-06 19:02
cheeken2u22-Nov-06 19:02 
AnswerRe: How to filter this kind of data ? Pin
Rob Graham23-Nov-06 6:39
Rob Graham23-Nov-06 6:39 
QuestionHow to Querying Document Properties from Full Text Catalogs in Sql Server 2005 Pin
fenil jacob22-Nov-06 18:21
fenil jacob22-Nov-06 18:21 
Questionhow can i read the wave file into a byte array? in c# Pin
zabota22-Nov-06 17:20
zabota22-Nov-06 17:20 
AnswerRe: how can i read the wave file into a byte array? in c# Pin
Rob Graham22-Nov-06 17:43
Rob Graham22-Nov-06 17:43 

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.