Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No IntelliSense in SSMS 2008 for Table Valued Function

I'm building a Table Valued Function in SSMS, and I'm expecting IntelliSense to help me select columns, but it doesn't. Consider this:

CREATE FUNCTION dbo.My_TVF
(   
)
RETURNS TABLE
AS
RETURN
(
    SELECT [PO].I -- Here I is my cursor, ctrl+space does nothing
    FROM dbo.SomePurchaseOrderView PO
    JOIN dbo.SomePurchaseOrderLineView POL ON PO.PO_NUM = POL.PO_NUM
    WHERE  PO.PO_NUM IN (
        SELECT TOP 500 PO_NUM 
        FROM dbo.SomeTable 
        WHERE PROCESSED = 0
    )
)
GO

I want it to suggest column names for the select clause.

Notes:

  • The cache is fresh (CTRL + SHIFT + R)
  • IntelliSense works fine in general, this is the only situation I've encountered where it doesn't.
  • I'm querying a view instead of a table, if it matters.

I know it often fails when there is some kind of syntax error in what you are writing, but I can execute my query just fine when I specify a column.

like image 993
MarioDS Avatar asked Feb 24 '26 13:02

MarioDS


1 Answers

On msdn it says: "IntelliSense is available for the SELECT statement when it is coded by itself, but not when the SELECT is contained in a CREATE FUNCTION statement."
Although, when testing it in my SSMS 2012, it does seem to work...

Source: http://msdn.microsoft.com/en-us/library/bb934481.aspx
(sorry, I don't have enough rep for a comment...)

like image 114
CoolWilly Avatar answered Feb 26 '26 11:02

CoolWilly



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!