SQL Server trigger that launches an external script file
<p>I've written a trigger that on update or insert launches a script. However when the trigger runs it ends up locking up my database and I have to do a restart to be able to run queries again. I'm not seeing anything in the trigger that would cause this.</p>

<pre><code>SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER TRIGGER [dbo].[CALCULATEDFIELDS]
ON  [dbo].[custom_values]
AFTER INSERT, UPDATE
AS 
    SET NOCOUNT ON;

    DECLARE @CUSTOMIZED_ID VARCHAR(15)

    SELECT @CUSTOMIZED_ID = (SELECT customized_id FROM inserted)

    BEGIN
        DECLARE @OUTSTRING varchar(300)

        BEGIN
            IF NOT @CUSTOMIZED_ID IS NULL
                SELECT @OUTSTRING = '\\DRIVE\Folder\Script.vbs '+ @CUSTOMIZED_ID
            ELSE
                SELECT @OUTSTRING = '\\DRIVE\Folder\Script.vbs '+ @CUSTOMIZED_ID

            EXEC master..xp_cmdshell @OUTSTRING, NO_OUTPUT
        END
    END
</code></pre>