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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 exports Triggers

Author  Topic 

doran_doran
Posting Yak Master

179 Posts

Posted - 2010-01-05 : 14:19:28
I have about 8 triggers in 3 tables. How do I export all of them at once in one file?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-05 : 14:42:31
You can use the scripting wizard in SSMS. Just right click on the database and go to tasks to find it. In the wizard, you can specify what objects you need.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

doran_doran
Posting Yak Master

179 Posts

Posted - 2010-01-05 : 14:51:38
I did that but that creates scripts for tables and all the contraints too.
Go to Top of Page

Hariarul
Posting Yak Master

160 Posts

Posted - 2010-01-05 : 15:22:14
In the wizard , under Table/View options set only value as true for the 'Triggers' alone. If the number for triggers is less, better do a sp_helptext <triggername>..
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-01-06 : 01:43:48
or
Change where xtype in ('p','fn') into where xtype ='tr' here


http://sqlblogcasts.com/blogs/madhivanan/archive/2007/12/13/script-out-procedures-and-functions-part-2.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -