I encountered a problem in the following query. When I go to update the column ID_Premesso with the value NULL the value does not change, while if I go to update with the value 0 it works.
SET @SQL = 'UPDATE ' + @NameTB + ' SET ID_Permesso = NULL WHERE ID_Timbratura = @IDTimbratura '
SET @PARAMS = '@IDTimbratura INT'
EXECUTE sp_executesql @SQL, @PARAMS, @IDTimbratura;