Function that returns table - user specific

  • I have a function which returns a table populated with data.
     
    If two users run this at the same time - I presume they get differant tables with differnat data - if the arguments they pass to the function are differant.
     
    Is there an article on how this may work somewhere?
     
    Cheers
  • create

    function function_test

    (

    @input varchar(30))

    RETURNS

    TABLE

    AS

    RETURN

    (SELECT * from sysobjects where name like @input)

     

    select

    * from dbo.function_test('xp_cmdshell')

    select

    * from dbo.function_test('sp_cycle_errorlog')

    They work even if the argument passed is the same. Do you want to have whitepapers related to this.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • Thanks - yes please - if could point me in the right direction.

  • No white papers on this but you can't you use profiler to track what is happening behind.

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com

  • Ta

  • Why do you need a white paper on the fact that if two users use a function, they get their own answers?  It's that way with any function in any language...

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply