Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565

    Unanswered: Tried to Solve a Problem and i got bit

    I was working on the thread "Call stored procedure within SELECT statement "

    but a funny thing happend
    i was going to suggest using a function instead of a proc but i cant seem to get it to run

    create function dbo.Fitem(@item int)
    Returns table
    as
    Return (select item, Result=(value * value) from tba
    where item = @item)
    GO

    select dbo.Fitem(1)

    then i get this

    Server: Msg 208, Level 16, State 1, Line 1
    Invalid object name 'dbo.Fitem'

    am i just too tired or what?

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Well, for starters you do not need to preface table functions with the owner; just scalar functions.

    Also, I believe you need a BEGIN and END statement in your function definition.

    And yes, your syntax is off. Check Books Online for structure and examples.
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Feb 2004
    Location
    San Antonio, TX
    Posts
    565
    got it
    just too tired
    thanks for the in-depth help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •