Does anyone know if it's possible to use SqlCmd Variables in a stored procedure within a database project?
For example I've added a $NewType SqlCmd variable to my database project. And set this variable to 'VARCHAR'.
But when I try and use this in a stored procedure in the project:
DECLARE @ClientName $(NewType) (100)
the project won't build, giving me a syntax error near @ClientName. I have SqlCmd mode turned on via VS SQL menu.
A similar example works in SQL Management Studio:
:setvar VARCHARTYPE "VARCHAR"
ALTER TABLE tempTable ADD newColumn $(VARCHARTYPE)(200);
Does anyone know why VS won't build the project and if there's a way around it?