Posted on 2006-03-27
Last Modified: 2012-05-05
I need to execute SP_HelpLogins and insert the data into 2 tables (since it returns two result sets)..  

Any suggestions?
Question by:DJMoonLight
    LVL 68

    Accepted Solution

    You are going to have to use VB or some other true programming environment.  Native T-SQL does not directly handle two different result sets from one sp.

    Or you could create a copy of the sp_helpLogins proc that left the temp tables containing the info there instead of deleting them, then use those temp tables yourself :-) .
    LVL 7

    Assisted Solution

    You could do a sp_helptext on the sp_helplogins,
    copy the code and create a new procedure (if possible, if permissions allow you to)

    Within the new procedure just alter it to add something like this to the code (before line 460 of the stored procedure)

    select * into MyPlainLogins from #tb2_PlainLogins
    select * into MyUA from #tb1_UA

    Then use MyPlainLogins and MyUA tables as you please.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
    Introduction In my previous article ( I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
    This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now