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?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.|||script the triggers
--
thanks,
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?
>|||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:
> 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:
> 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:
> 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?
>
Same way you run them on your first server - connect with Query
Analyzer, select the proper database, and run the CREATE TRIGGER script.
Friday, February 24, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment