When a Trigger is compiled by TOAD for SQL, using the F9 button rather than F5, it is inserted into syscomments in the wrong formatting, as if it were a single line, where line breaks are disregarded. The problem is that when I use sp_helptext to bring the text of the object, it looks in syscomments and therefore the result is broken lines without any sense, and I can not use that text to recompile the object.
If I access SQL Management Studio and do the following in the trigger that was compiled with F9 in TOAD for SQL:
To modify a DML trigger Object Browser, connect to an instance of the Database Engine and expand it. Tables and expand the table that contains the trigger you want to modify. Triggers, right-click the trigger to be modified, and click Modify. Run.
It opens a text editor with the trigger formatted correctly.
My question is to find out what this Modify option in SQL Manegement Studio performs so that it can format the object correctly. Well I need to get what sp_helptext brings, format it correctly, to be able to create this trigger in another table.