Click here to Skip to main content
15,915,508 members
Home / Discussions / Database
   

Database

 
GeneralRe: updating doesn't work Pin
Colin Angus Mackay24-Oct-04 13:10
Colin Angus Mackay24-Oct-04 13:10 
GeneraldateTime column in datagrid Pin
Miri Ofir24-Oct-04 5:53
Miri Ofir24-Oct-04 5:53 
GeneralRe: dateTime column in datagrid Pin
afronaut24-Oct-04 6:38
afronaut24-Oct-04 6:38 
GeneralRe: dateTime column in datagrid Pin
Miri Ofir25-Oct-04 1:55
Miri Ofir25-Oct-04 1:55 
GeneralGetting metadata from SQL Server Pin
Anonymous23-Oct-04 22:53
Anonymous23-Oct-04 22:53 
GeneralRe: Getting metadata from SQL Server Pin
Duncan Edwards Jones24-Oct-04 1:11
professionalDuncan Edwards Jones24-Oct-04 1:11 
GeneralRe: Getting metadata from SQL Server Pin
afronaut24-Oct-04 6:26
afronaut24-Oct-04 6:26 
GeneralRe: Getting metadata from SQL Server Pin
Duncan Edwards Jones24-Oct-04 7:39
professionalDuncan Edwards Jones24-Oct-04 7:39 
GeneralSQL Packages Pin
maro1823-Oct-04 22:01
maro1823-Oct-04 22:01 
GeneralRe: SQL Packages Pin
DreadPirateRoberts27-Oct-04 6:12
DreadPirateRoberts27-Oct-04 6:12 
QuestionSQl statement doesn't work why? Pin
jlawren723-Oct-04 14:12
jlawren723-Oct-04 14:12 
AnswerRe: SQl statement doesn't work why? Pin
afronaut24-Oct-04 6:29
afronaut24-Oct-04 6:29 
QuestionInsert into Syntax error? Pin
mikhaelb23-Oct-04 12:54
mikhaelb23-Oct-04 12:54 
AnswerRe: Insert into Syntax error? Pin
Colin Angus Mackay23-Oct-04 14:02
Colin Angus Mackay23-Oct-04 14:02 
GeneralRe: Insert into Syntax error? Pin
jlawren723-Oct-04 14:08
jlawren723-Oct-04 14:08 
GeneralRe: Insert into Syntax error? Pin
Colin Angus Mackay23-Oct-04 14:29
Colin Angus Mackay23-Oct-04 14:29 
Generalsql to export access table to html file Pin
jlawren723-Oct-04 10:41
jlawren723-Oct-04 10:41 
GeneralRe: sql to export access table to html file Pin
afronaut24-Oct-04 6:46
afronaut24-Oct-04 6:46 
GeneralMS OLAP Visual C++ (.NET) samples Pin
Ilgar22-Oct-04 23:43
Ilgar22-Oct-04 23:43 
GeneralProblem with SQL Server RaiseError with C# Pin
Graham W22-Oct-04 0:58
Graham W22-Oct-04 0:58 
GeneralSQL statement against MS access Pin
21-Oct-04 14:20
suss21-Oct-04 14:20 
GeneralRe: SQL statement against MS access Pin
afronaut21-Oct-04 14:43
afronaut21-Oct-04 14:43 
GeneralRe: SQL statement against MS access Pin
jlawren721-Oct-04 15:53
jlawren721-Oct-04 15:53 
GeneralRe: SQL statement against MS access Pin
afronaut24-Oct-04 6:11
afronaut24-Oct-04 6:11 
GeneralRecursive Triggers Pin
afronaut21-Oct-04 13:33
afronaut21-Oct-04 13:33 
Hey all, just for giggles, I was trying to figure out how these works. I created the following table:

Create Table Emps(<br />
	EmployeeID int identity(1,1),<br />
	EmpName	varchar(100), <br />
	ManagerID	int, <br />
	ActiveFlag	char(1)<br />
)


insert into emps(empname)values('Big Boss')<br />
insert into emps(empname, managerid)values('David', 1)<br />
insert into emps(empname, managerid)values('Holly', 2)<br />
insert into emps(empname, managerid)values('Samwell', 3)<br />
insert into emps(empname, managerid)values('Ian', 4)


-- set everyone active
update emps set activeflag = 'Y'

CREATE TRIGGER EmpTrig ON emps For UPDATE <br />
AS<br />
UPDATE Emps  SET ActiveFlag= i.activeflag <br />
FROM (Emps e INNER JOIN Inserted i ON e.managerid = i.employeeid)<br />
GO


The idea was that this would set everyone in a heirarchy "Inactive" if the manager was set inactive. Unfortunately, it does this only one level deep. How can I enable recursive triggers?

Thanks in advance -

*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";

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.