declare @s varchar(100) = '[000]-[0000000]'
;with num(n) as
(
select number from master..spt_values where type = 'P'
),
p(s, e) as
(
select
charindex('[', @s, n),
charindex(']', @s, n)
from
num
where
n between 1 and len(@s) and
(charindex('[', @s, n) = n or charindex(']', @s, n) = n)
)
select
@s = stuff(@s, s + 1, e - s - 1, replicate('1', e - s - 1))
from
p
where
s > 0 and s < e and
substring(@s, s + 1, e - s - 1) = replicate('0', e - s - 1)
select @s