I am using the below code get completed code of triggers in the selected database.
select [definition] +' ' + 'GO'
from sys.sql_modules m
inner join sys.objects obj on obj.object_id=m.object_id
where obj.type ='TR'
Requirement: I would like to export the above trigger code as C:\TMP\Trigger.sql with help of T-SQL coding instead of Generate scripts using script wizard. I am not so strong in SQL Server. Can someone help me with this?