how do I do in SSMS to have a script loaded each time I press "New Query"?
<p>When I press New Query on SQL Server Management Studio (SSMS), according to the following picture:</p>

<p><a href="https://i.stack.imgur.com/DMNb6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DMNb6.png" alt="enter image description here"></a></p>

<p>I would like the following script in a new tab.
would this be possible?</p>

<pre><code>USE AdventureWorks2012;
GO

-- SET XACT_ABORT ON will render the transaction uncommittable
-- when the constraint violation occurs.
SET XACT_ABORT ON;

BEGIN TRY
    BEGIN TRANSACTION;

    ------------------------------------------------------




    ------------------------------------------------------
    COMMIT TRANSACTION;
END TRY
BEGIN CATCH
    -- Test XACT_STATE for 0, 1, or -1.
    -- If 1, the transaction is committable.
    -- If -1, the transaction is uncommittable and should 
    --     be rolled back.
    -- XACT_STATE = 0 means there is no transaction and
    --     a commit or rollback operation would generate an error.

    -- Test whether the transaction is uncommittable.
    IF (XACT_STATE()) = -1
    BEGIN
        PRINT 'The transaction is in an uncommittable state.' +
              ' Rolling back transaction.'
        ROLLBACK TRANSACTION;
    END;

    -- Test whether the transaction is active and valid.
    IF (XACT_STATE()) = 1
    BEGIN
        PRINT 'The transaction is committable.' + 
              ' Committing transaction.'
        COMMIT TRANSACTION;   
    END;
END CATCH;
GO
</code></pre>

<p>there is a very similar question on the link below, but it is not working for me. SSMS 2014.</p>

<p><a href="https://stackoverflow.com/questions/593047/mssql-server-management-studio-ssms-2005-new-query-template">MSSQL Server Management Studio (SSMS) 2005 New Query Template</a></p>