September 12, 2007 at 6:55 am
I am trying to send the output from sp_helplogins to a table, however, whenever I run it the results come in two windows...Does anybody get what I mean? Generally, I would just create the table, then send the results to the table, however, there are two outputs from the stored proceedure, with me wanting both...What can I do to send these results to a table? Please run sp_helplogins to get a better understanding of what I mean. Thanks in advance for any help.
-Kyle
September 12, 2007 at 7:54 am
Kyle,
my first question would be which of the two result sets do you want to insert in your table?. You obviously can't insert them both into the same table because they have different number of columns and different datatypes.
Once you kow what you need, I suggest look into the code of sp_helplogins (click modify on the procedure name) and take the pieces of code you need to write your own version.
Hope this helps
Markusb
[font="Verdana"]Markus Bohse[/font]
September 12, 2007 at 7:59 am
I want both of the result sets. How do I modify prcedure?
-Kyle
September 12, 2007 at 8:29 am
From T-SQL you will not be able to get both of the result sets.
As Markus mentioned, you could take the definition of sp_helplogins
select definition from sys.all_sql_modules where object_id = object_id('sp_helplogins')
and copy it and modify the copy to return either a single table, or break it up into two stored procedures. Luckily this stored procedure does not use any restricted code, so you can just execute its contents as a normal user/dbo.
Andras
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply