In this case to my way of thinking, you can do the following:
WHERE bt.ProductoID = ISNULL(@ProductoID,bt.ProductoID)
AND bt.Talla=ISNULL(@Talla,bt.Talla)
AND bt.Año=ISNULL(@Año,bt.Año)
How does it work? What ISNULL does is that if the Search parameter is not null, it restricts the search to what matches that parameter, but if that parameter arrives as null then it takes everything that exists in bt.Year.
Now there is an exception with the handling of null values, in Sql server you can not compare if Null = Null then you must use a double ISNULL assigning a value if it is null, and the same on the right side, for example a 0 for make a 0 = 0 leaving as follows.
WHERE ISNULL(bt.ProductoID,0) = ISNULL(@ProductoID,ISNULL(bt.ProductoID,0))
AND ISNULL(bt.Talla,0)=ISNULL(@Talla,ISNULL(bt.Talla,0))
AND ISNULL(bt.Año,0)=ISNULL(@Año,ISNULL(bt.Año,0))
Added to this, I recommend that if you are working with parameters and variables, identify with @P the parameters and @V the variables, this by good practices.
@PParametro
@VVariable
And a small practical example:
DECLARE @PDescripcion VARCHAR(30)=NULL,
@PId INT
DECLARE @VDescripcion AS VARCHAR(30)='Descripcion1'
DECLARE @Tabla AS TABLE(
ID INT,
Descripcion VARCHAR(30)
)
INSERT INTO @Tabla
SELECT 1, 'Descripcion1'
INSERT INTO @Tabla
SELECT 2, 'Descripcion2'
INSERT INTO @Tabla
SELECT NULL, 'Descripcion3'
--Utilizando el parametro
SELECT *
FROM @Tabla
WHERE Descripcion = ISNULL(@PDescripcion,Descripcion) --Si el parametro descripcion es nulo entonces toma todo el contenido en Descripcion
--Utilizando la variable
SELECT *
FROM @Tabla
WHERE Descripcion = ISNULL(@VDescripcion,Descripcion) --Como la variable no es nula busca las coincidencias con la variable
--Comparando valores nulos
SELECT *
FROM @Tabla
WHERE ID = ISNULL(@PDescripcion,ID) --No podras ver el valor nulo por no poder comparar null con null
SELECT *
FROM @Tabla
WHERE ISNULL(ID,0) = ISNULL(@PDescripcion,ISNULL(ID,0))-- Puedes ver el registro null ya que comparas en lugar de null = null con 0 = 0
I hope my answer is helpful.