No formatting options for UDF calls
Hanneke
Posts: 8 New member
I have installed SQL Prompt en set up a profile, but I can't find any options for how to format User defined function calls.
I prefer the parameters to be aligned from top to bottom. Like this:
EXEC dbo.udf
@param1
, @param2
, @param3
But for now my profile only puts all the paramters behind the function call. Did I miss an option - or is it not present? And if the latter case is true, could it be developed in the future?
Just to clarify; I know there are options for function calls, but I would actually like the SQL native calls like DATEADD to remain on one line.
I prefer the parameters to be aligned from top to bottom. Like this:
EXEC dbo.udf
@param1
, @param2
, @param3
But for now my profile only puts all the paramters behind the function call. Did I miss an option - or is it not present? And if the latter case is true, could it be developed in the future?
Just to clarify; I know there are options for function calls, but I would actually like the SQL native calls like DATEADD to remain on one line.
Tagged:
Answers
Dan Jary | Redgate Software
Have you visited our Help Center?
I tried this, and I realized that the issue lies with what the code formatting recognises as lists.
An example - I have a call to a stored procedure which gets formatted correctly with those settings, like this:
Then later on in this same code block I have another procedure call, but it gets formatted like this:
So where does this difference come from?
I tried with those settings, but I realized the issue lies with what the formatting recognizes as lists. One procedure call with parameters gets recognized as a list, another isn't.
Example
This works well:
This gets formatted on one line:
Dan Jary | Redgate Software
Have you visited our Help Center?
I attached it here as a txt file (json isn't allowed as an attachment here). I also noticed something else; If a procedure call has named paramters, it gets formatted correctly. However, if the parameters are unnamed, it gets formatted on one line.
I hope this helps you zoom in on the issue.
Dan Jary | Redgate Software
Have you visited our Help Center?