Lets say there is a part in the song that has a dominant chord B major but I use a pattern that's built of

B A# B C# D# E F# G A(without #) B ? How would You name that scale according to B as a root note? I might miss something...it's like close to the F# locrian but 5th step doesn't fit... Alos I include both A and A# a bit like in the beebop scale...Any ideas ?

That scale is a little used one, but a great one to check out. It's the 5th mode of Melodic Minor, which is like a Mixolydian Scale with the 6th note lowered

B C# D# E F# G A B or R 2 3 4 5 b6 b7 R

The A# is just a lower neighbor, so in this case it's just acting as a chromatic lower neighbor to B, B-A#-B, prolonging B by a few notes. So I wouldn't consider that note as part of the scale, just an ornament.

Cool. Yeah a lot of the time those notes that don't make sense in a scale can make sense when looked at as ornaments. So I usually start there if I see a note that doesn't fit the scale I'm on, and try to figure out if it's part of a neighbor tone, passing tone, or other ornament. Then dig into the rest of the scale notes from there.

Almost. Those notes, E F G# A are from the A Harmonic Minor Scale. It's the same concept, but in this case it's the 5th mode of Harmonic Minor being used. This is commonly used in jazz, and in metal, playing A harmonic minor over an E chord, it creates a cool 7b9 sound, or 7b9b13 in a jazz setting.

Hope that make sense. same idea, just different scale system, Harmonic Vs. Melodic.

Yep...it makes sense I just gave the harmonics minor example as another example of using 5th step of the scale as a root note for the chord progression so we did understand each other well Thanx for help Matt!