Hm, strange procedure...
First, you have the argument and the variable with same names.
Second, you should use 'SET' to assign a variable:
set @sql = ...
Third, your
@exist = ...
must be inside the string
I would recommend you to read some tutorials about T-SQL