Table function column names beginning with an @

Provides intelligent code completion for SQL Server editors.

Moderators: Anu Deshpande, Aaron Law, David Priddle

Table function column names beginning with an @

Postby rhodrie » Fri Apr 04, 2014 11:15 am

Code: Select all
CREATE FUNCTION fn_MyQuery ()
RETURNS TABLE AS RETURN
(SELECT 'test' [@Attribute], 'element' [Element]);
GO
SELECT  fn_m.* FROM fn_MyQuery() fn_m
FOR XML PATH ('Test'), TYPE, ELEMENTS


In the above example SQL Prompt (6.1.0.67) identifies fn_MyQuery as having one parameter @Attribute, returning a single column Element.
rhodrie
 
Posts: 8
Joined: Mon May 28, 2012 2:40 pm

Postby Aaron Law » Fri Apr 04, 2014 2:39 pm

Hi rhodrie,

Thanks for reporting this, I can recreate it here and will look into a fix for you. Seems like we pull down the columns and parameters in a single query and then differentiate them based on if they start with an '@', which clearly doesn't work in this case!

Thanks,
Aaron.
Aaron Law
 
Posts: 262
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software

Postby Aaron Law » Mon Apr 07, 2014 5:07 pm

I think I've got a fix for this. Unfortunately it just missed out on making our 6.3 release which we're currently in the process of release testing, but I've made a private build for you and the fix will be included in a future release of prompt.

Thanks again for reporting it!
Aaron Law
 
Posts: 262
Joined: Fri Jun 28, 2013 10:56 am
Location: Red Gate Software


Return to SQL Prompt 6

Who is online

Users browsing this forum: David Priddle and 0 guests