Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Unanswered: how to call a function in storedprocedure using Sqlserver 2008?

    Hi,
    how to call a sql function in storedprocedure using Sqlserver 2008?
    Last edited by hariinakoti; 09-12-12 at 04:23.

  2. #2
    Join Date
    Oct 2009
    Location
    221B Baker St.
    Posts
    486
    Does your question have AnyThing to do with the Brilliant Database product?

    If not, suggest you repost in the SQL Server part of the forum - unless a kind moderator will relocate your tioic.
    Last edited by papadi; 09-13-12 at 16:50.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd like to think that I'm a kind moderator.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,799
    Provided Answers: 11
    Well, you are kind of a moderator....

    Functions in SQL Server are only called as part of a query. GETDATE() is a familiar and easy function, and it is called wherever a literal date value can go. For example:
    Code:
    select getdate()

  5. #5
    Join Date
    Aug 2012
    Posts
    30
    Quote Originally Posted by hariinakoti View Post
    Hi,
    how to call a sql function in storedprocedure using Sqlserver 2008?
    depends on type of function

    it if its scalar function it will be returning a single value and you can use it as if you use scalar value

    ie directly in SELECT WHERE etc

    Code:
    SELECT dbo.yourscalarfunction(....),...
    FROM ...
    WHERE dbo.yourscalarfunction(....),..
    ORDER BY dbo.yourscalarfunction(....),...

    if its table valued function you can use it just like table

    Code:
    SELECT *
    FROM dbo.TableValuedFunction(...)
    ...
    
    SELECT 
    FROM table t
    JOIN dbo.TableValuedFunction(.....)

Posting Permissions

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