Activity overview
Latest activity by bstrautin
The use case is writing a query with a CROSS APPLY where the function being applied outputs a column with the same name as a table that it's being applied against, e.g. something like: <br>select p.partno, p.description, c.partno<br><br><div>from Parts p</div><div><br></div><div>cross apply dbo.get_children([cursor here, wanting "p.partno", but typing "pa(tab)" gives me "gc.partno"]) gc</div><div><br></div><div></div> It is super-annoying that gc's partno is prompted in its own parameter list, above p's. The original example just demonstrates the problem minimally. Also, the editor continues to not post code properly, so here it is again, not in a code block: select p.partno, p.description, c.partno from Parts p cross apply dbo.get_children([cursor here, wanting "p.partno", but typing "pa(tab)" gives me "gc.partno"]) gc
/ comments
The use case is writing a query with a CROSS APPLY where the function being applied outputs a column with the same name as a table that it's being applied against, e.g. something like:<br>select p....
It should NOT qualify the x with [f], because [f] refers to the function being called, and it's impossible to use the function's output as its own input parameters. P.S. tried the delete+enter trick, but no luck.
/ comments
It should NOT qualify the x with [f], because [f] refers to the function being called, and it's impossible to use the function's output as its own input parameters.P.S. tried the delete+enter trick...
Also, there is apparently a bug in the forum software; the code is present when I edit my post, but it only displays "go" Code below (not in a code block): go create function dbo.foo (@x int) returns @foo table(x int) as begin insert @foo(x) values (1) return end go select * from dbo.foo(x) f
/ comments
Also, there is apparently a bug in the forum software; the code is present when I edit my post, but it only displays "go"Code below (not in a code block):gocreate function dbo.foo (@x int)returns @...
Bug: table-valued function output columns are prompted in the parameter list
SQL Prompt suggests the output columns of table-valued functions as as parameter values to the function itself.For example, with this code, place cursor after "dbo.foo(x" and hit Ctrl-Space. SQL Pr...
row_number() returns bigint, but SQL Prompt displays int
The summary popup for the row_number() function reports that it returns int, but it actually returns bigint.select row_number() over (order by o.object_id)
from sys.objects o
Column aliases in the form "x = [column name]" break the "All non-aggregated columns" group by functionality.
For example, if you type this, and pick "All non-aggregated columns", you get "=" instead of "o.type_desc":
select t = o.type_desc, count(*)
from sys.objects o
group by
/ comments
Column aliases in the form "x = [column name]" break the "All non-aggregated columns" group by functionality.
For example, if you type this, and pick "All non-aggregated columns", you get "=" inste...
ALTER after GO suppresses FUNCTION, PROCEDURE, VIEW, TRIGGER
If a GO statement is not preceded by a newline, e.g. is first text in a query window, the autocomplete suggestions for a subsequent ALTER will exclude FUNCTION, PROC, PROCEDURE, VIEW, and TRIGGER, ...
table name prepended to column names in INSERT column list
If the "Qualify column names with table name" option is set, SQL Prompt incorrectly qualifies column names in an INSERT statement's column list.
For example, for table 'Foo' with column 'FooID', if...