Error passing variable table type to a stored procedure
Sorry, I haven't noticed about something:

I use a script to erase all the database, to start all from zero, this script is useful to test my stored procedures, so in the stored procdure
SP_NUEVO_BD (in the code below), I drop the stored procedure SP_NUEVO_VAR, I drop the type TVariable, then I create the type, then I create the stored procedure.

Something is happening that I cannot run the full script, but when I run it individually it works:

Here is the script below:

USE foxtrot
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO
-- Nueva Base de datos
SET NOCOUNT ON
EXEC SP_NUEVO_DB 

-- Script de ejemplo, variables de ejemplo 

DECLARE @no_serie as varchar (20),
        @folio_terminal as int,
        @err_cod as int,
        @folio_solicitud as int
        SET @no_serie='282-716-200'

-- Tabla de ejemplos de nuevas variables

-- Nuevo Registro de terminal ùnica

EXEC SP_NUEVO_TERMINAL   @no_serie, @folio_terminal OUT, @err_cod OUT

PRINT 'No de serie:['   +@no_serie+']' PRINT 'Folio terminal:['+CAST(@folio_terminal as varchar(20))+ ']' PRINT '@err_cod:['+CAST(@err_cod as varchar(20))+']'

-- Nuevo Registro de terminal, con sistema operativo, modelo  

EXEC SP_NUEVO_REGISTRO_TERMINAL 'T00001','282-716-200','QTG5001','EOS123','VX610', @err_cod OUTPUT

PRINT 'err_cod:['+CAST(@err_cod as varchar(20))+']'

-- Script de nuevas variables 

DECLARE @T TVARIABLE 
INSERT INTO  @T   VALUES ( '#var1','1')
INSERT INTO  @T   VALUES ( '#var2','2')
INSERT INTO  @T   VALUES ( '#var3','3')
INSERT INTO  @T   VALUES ( '#var4','4')
INSERT INTO  @T   VALUES ( '#var5','5')
INSERT INTO  @T   VALUES ( '#var6','6')
INSERT INTO  @T   VALUES ( '#var7','7')
--SELECT * FROM @T
EXEC SP_NUEVO_VAR   @T_Variable=@T


Yu can see that the implmentation I refer in the first post is at the end of the script, when I executed indivudually it works fine, but when I run the complete script it doesn´t, considering I make all the process of deleting the stored procedure and the type, then I recreate it.