Table function column names beginning with an @

rhodrierhodrie Posts: 18 Bronze 3
edited April 7, 2014 12:07PM in SQL Prompt
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.

Comments

  • Aaron LAaron L Posts: 596 New member
    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 LAaron L Posts: 596 New member
    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!
Sign In or Register to comment.