Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
CLages
Posting Yak Master
116 Posts |
Posted - 2006-03-08 : 07:29:50
|
| Hi, I would like to make a Trigger in a Table MOVIMENT to Drop OR Truncate Itselfsomething like thisCREATE TRIGGER [DropTableMov] ON dbo.moviment FOR INSERT ASIF (SELECT mov_trigger FROM INSERTED) = 'C' Drop Table dbo.moviment; or Truncate Table dbo.moviment is it Possible?TksC. Lages |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2006-03-08 : 10:52:11
|
| Triggers cannot modify the database schema.And why in the WORLD would you want to do this? |
 |
|
|
CLages
Posting Yak Master
116 Posts |
Posted - 2006-03-10 : 06:40:18
|
| the main idea wasif a table get too many rows, truncate itsand start againC. Lages |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2006-03-10 : 10:43:42
|
| Please don't do this.This falls within the realm of database maintenance, not application logic. Use a scheduled job to delete old records. |
 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-03-10 : 10:57:35
|
quote: Originally posted by CLages the main idea wasif a table get too many rows, truncate itsand start againC. Lages
If your data is that unimportant, just don't save it to begin with.CODO ERGO SUM |
 |
|
|
|
|
|