Internal Variables in the Workflow Query/Script Generator
I wanted to use the Workflow SQL Query/Script Generator to run with a similar script to this:
DECLARE @SQL VARCHAR(1024)
SET @SQL = 'SELECT * FROM vComputer WHERE Name LIKE ''' + @Name + ''''
In this script, @SQL needs to be an internal variable for the script and @Name needs to be the Input Parameter. The resulting query, of course, will be the output parameter.
When I run the script in the Query/Script Generator, it takes BOTH @Name and SQL as parameters and therefore, @SQL can be written to from the user. There is no way of telling the Generator that @SQL is not to be touched. I have tried setting "Db parameter" to false and setting @SQL to be nullable.
I still want @Name to be an input parameter, but can we please be able to set a variable as being "internal" or just not include it in the list of parameters, please? This would also allow me to create more readable queries, rather than having to make them run in more than one line.