Author |
Topic |
X002548
Not Just a Number
15586 Posts |
Posted - 2007-09-27 : 15:34:49
|
I would have put money down the trigger would have firedCREATE TABLE myTable00(Col1 int)CREATE TABLE myTable99(Col1 int)GOCREATE TRIGGER myTrigge00 ON myTable00 FOR DELETE AS BEGIN INSERT INTO myTable99(Col1) SELECT Col1 FROM deleted END GOINSERT INTO myTable00(Col1) SELECT 1 UNION ALLSELECT 2 UNION ALLSELECT 3GOSELECT * FROM myTable00DELETE FROM myTable00 WHERE Col1 = 1TRUNCATE TABLE myTable00SELECT * FROM myTable99GODROP TABLE myTable00DROP TABLE myTable99 Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
|
Kristen
Test
22859 Posts |
Posted - 2007-09-27 : 15:39:49
|
You know that BCP won't fire them either (unless you ask nicely), eh? |
 |
|
X002548
Not Just a Number
15586 Posts |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-09-27 : 17:40:24
|
In SQL 2000 you get only INSERT, UPDATE, or DELETE statement triggers.In SQL 2005 you also get CREATE, ALTER, DROP, GRANT, DENY, REVOKE, or UPDATE STATISTICS statement triggers.Still no TRUNCATE triggers. CODO ERGO SUM |
 |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-09-27 : 17:54:48
|
Doesnt look like its gonna make it into 2008 ether Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-09-27 : 18:16:41
|
I can understand why there is no trigger on a TRUNCATE. The idea is to make it run fast so you don't want any trigger getting in the way. Maybe they could could add an option:TRUNCATE TABLE MYTABLE WITH DO_NOT_EXECUTE_TRUNCATE_TRIGGERCODO ERGO SUM |
 |
|
Kristen
Test
22859 Posts |
Posted - 2007-09-27 : 20:03:26
|
"The idea is to make it run fast ..."In that case I think your proposed syntax should be changed to:TRUNCATE TABLE MYTABLE WITH PLEASE_EXECUTE_TRUNCATE_TRIGGER |
 |
|
pootle_flump
1064 Posts |
Posted - 2007-09-28 : 12:12:59
|
Truncate is a DDL command anyway so certainly not captured in 2000 (nor 2005 either but at least it has DDL triggers). |
 |
|
X002548
Not Just a Number
15586 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-09-28 : 14:01:37
|
which trigger?with SELECT * INTO TABLE FROM TABLE2 you're creating a table. so it can't have triggers yet._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
X002548
Not Just a Number
15586 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-09-28 : 14:41:39
|
you mean thw absynth? that's some good stuff!_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
X002548
Not Just a Number
15586 Posts |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-09-28 : 15:00:50
|
absolute. i probably don't get it then.. _______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|