I have a SQL script that acquires table names and creates trigger for those tables. When I open the trigger after creating it all of the code is on one line. How would I go about adding tab and new line characters within the script to make the trigger more readable.
Example code:
SET @SQL = 'ALTER TRIGGER [dbo].[TRG_' + SUBSTRING(@TABLE_NAME,5, LEN(@TABLE_NAME)) + '_$AUD] '
SET @SQL = @SQL + 'ON [dbo].[' + @TABLE_NAME + '] '
SET @SQL = @SQL + 'FOR UPDATE, DELETE '
SET @SQL = @SQL + 'AS '
SET @SQL = @SQL + 'DECLARE '
SET @SQL = @SQL + '@BIT INT, '
SET @SQL = @SQL + '@FIELD INT, '
SET @SQL = @SQL + '@CHAR INT '