|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Copy triggers between databases without copying tableIs there any way to copy a trigger between SQL Server databases without
copying the table? In other words, is there some what to apply a trigger to a table through a script? SMC wrote:
> Is there any way to copy a trigger between SQL Server databases without Just dump the trigger to a script file on one server, then run that > copying the table? In other words, is there some what to apply a > trigger to a table through a script? > script on the second server. You should be creating your triggers using script in the first place, and archiving those scripts off into some version control software. Tracy,
Thanks for the response! I do write all my triggers as a script, but how do you "run that script on the second server"? Is there a link that could show me how to do this? Shane Tracy McKibben wrote: Show quote > SMC wrote: > > Is there any way to copy a trigger between SQL Server databases without > > copying the table? In other words, is there some what to apply a > > trigger to a table through a script? > > > > Just dump the trigger to a script file on one server, then run that > script on the second server. You should be creating your triggers using > script in the first place, and archiving those scripts off into some > version control software. I figured it out. I can just run it in Query Analyzer.
Thanks for all the help! SMC wrote: Show quote > Tracy, > > Thanks for the response! > > I do write all my triggers as a script, but how do you "run that script > on the second server"? Is there a link that could show me how to do > this? > > Shane > > Tracy McKibben wrote: > > SMC wrote: > > > Is there any way to copy a trigger between SQL Server databases without > > > copying the table? In other words, is there some what to apply a > > > trigger to a table through a script? > > > > > > > Just dump the trigger to a script file on one server, then run that > > script on the second server. You should be creating your triggers using > > script in the first place, and archiving those scripts off into some > > version control software. SMC wrote:
> Tracy, Same way you run them on your first server - connect with Query > > Thanks for the response! > > I do write all my triggers as a script, but how do you "run that script > on the second server"? Is there a link that could show me how to do > this? > Analyzer, select the proper database, and run the CREATE TRIGGER script. script the triggers
-- Show quotethanks, ------------------------------------ joey "SMC" wrote: > Is there any way to copy a trigger between SQL Server databases without > copying the table? In other words, is there some what to apply a > trigger to a table through a script? > > |
|||||||||||||||||||||||