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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-05-18 : 08:24:05
|
| shown writes "respected sql team,Will u be able to give me a script or coding for writing the same trigger for many tables, so that once I run the script or code,it should generate the triggers for all the tables with appropriate columns subtituted. regards shown_sunny" |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-05-18 : 08:28:57
|
| Why would you want to do this?MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-05-19 : 14:08:44
|
quote: Originally posted by derrickleggett Why would you want to do this?
Dunno why shown_sunny wants to do it, but FWIW we have an SProc that generates the appropriate source code for triggers, it takes care of:Columns for EditNumber and UpdateDate, which exist in all our tables, which get incremented/set to GetDate() respectively.We also generally force empty [varchar] columns to NULL.And set a CreateDate column if it happens to be NULL (rubbish imported data etc.)And put anything from DELETED into an ARCHIVE table if one exists (original table name with "_ARCHIVE" suffixed to it, say)Regards,Kristen |
 |
|
|
|
|
|