Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2003
    Location
    Boise, Idaho
    Posts
    9

    Unanswered: Use of function data

    This has got to be simple but somehow I am missing the logic: I am trying to pull the 'Account Name' Column from the following function:

    EXEC master..xp_logininfo 'DOMAIN\NTGROUP', 'members'

    and insert the column into a users table 'Account Name' column. Please help, new to SQL and not having much fun at the momment.

    Thank You!

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    Code:
    create table #tmp (AccountName nvarchar(128) null, AccountType nvarchar(7) null, AccountPrivilege nvarchar(7) null, AccountLogin nvarchar(128) null, PermissionPath nvarchar(128) null)
    insert #tmp
       EXEC master..xp_logininfo 'EAGLE\SQLAdmin', 'members'
    select * from #tmp

  3. #3
    Join Date
    Dec 2003
    Location
    Boise, Idaho
    Posts
    9
    Thank you for your reply, however, I would prefer not to make a temporary table as this procedure could be called several times... maybe even 50 times in an hour. This is not for a one time data transfer. If I could somehow use a SELECT statement on the output it would be a much better solution. THANK YOU.

  4. #4
    Join Date
    Dec 2003
    Location
    Boise, Idaho
    Posts
    9
    Thank you for your reply, however, I would prefer not to make a temporary table as this procedure could be called several times... maybe even 50 times in an hour. This is not for a one time data transfer. If I could somehow use a SELECT statement on the output it would be a much better solution. THANK YOU.

  5. #5
    Join Date
    Sep 2003
    Posts
    522
    you can execute it 10000 in an hour, no problem.

  6. #6
    Join Date
    Dec 2003
    Location
    Boise, Idaho
    Posts
    9
    Just for my own knowledge does #tmp create a table then drop it? Or is it some type of variable. I don't see the table after execution of the proceedure.

    Appreciate your responses... Thank You

  7. #7
    Join Date
    Sep 2003
    Posts
    522
    don't drop the #tmp, under certain circumstances this causes sp to recompile (affects performance). the temp table goes out of scope upon completion of the execution of the sp.

Posting Permissions

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