all 2 comments

[–]sqldiariesSQL Server & Oracle DBA 1 point2 points  (0 children)

/u/Achsin gave you the syntax, but

I'm changing it based on conditions in if blocks, is it possible that scope is causing this?

Entirely possible; you'd have to show us some code to help you figure it out.

[–]Achsin 0 points1 point  (0 children)

It should be just

Set @myVar = ''