Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Triggers Execution Expand / Collapse
Author
Message
Posted Friday, December 7, 2012 3:27 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, February 21, 2013 9:49 AM
Points: 16, Visits: 112
I HAVE HAVING 2 DATABASES 1 IS HAVING MORE THAN 25 TRIGGERS.I HAVE TO TAKE ALL 25 TRIGGERS AT A TIME AND EXECUTE IT IN ANOTHER DATABASE AT A TIME WITHOUT EXECUTING INDIVIDUALLY IS IT POSIBLE/
Post #1393963
Posted Friday, December 7, 2012 3:33 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 8:05 AM
Points: 42,829, Visits: 35,959
Your caps lock appears to be stuck, and I don't appreciate being shouted at...

Now, can you explain in a little more detail what you're trying to do here?



Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1393964
Posted Friday, December 7, 2012 3:57 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, December 13, 2013 4:35 AM
Points: 386, Visits: 211
Do you mean you want to copy the triggers to the other database?

Right click on the database and generate scripts.
Under scripting options, advanced you can select to script triggers.

You should be able to create a script of all the triggers which you can then run in the other database.

You can probably also do this via ssis.

If you want to exercise the triggers then you will have to look at them individually and see what updates to the underlying tables you need to make.



Cursors never.
DTS - only when needed and never to control.
Post #1393975
Posted Friday, December 7, 2012 7:04 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Thursday, February 21, 2013 9:49 AM
Points: 16, Visits: 112
I want to take only Triggers in Sql server 2008 R2 database to execute in another database.The Database having more than 25 triggers instead of excuting individually i want to take and execute 25 triggers at a time
Post #1394049
Posted Friday, December 7, 2012 7:11 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, December 13, 2013 4:35 AM
Points: 386, Visits: 211
What do you mean by execute?
Do you want to add them to the tables in the database - if so see my previous post.
Do you want to cause the triggers to run by updating the underlying tables - if so see my previous post.
Something else
Maybe you want the triggers to be added to the tables in db1 and update the tables in db2.
In which case use the inserted and deleted tables to run the updates.



Cursors never.
DTS - only when needed and never to control.
Post #1394053
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse