Solved

capture xp_msver results into temp table

Posted on 2006-11-03
4
707 Views
Last Modified: 2012-05-05
How can I get the results of a system proc into a temp table? I tried this, but it breaks:

select xp_msver Language
into #junk

Yet if you run "xp_msver Language" by itself, it works fine and returns 1 record with a few columns.
0
Comment
Question by:SweatCoder
  • 2
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 17868729
create table #temp (i int, Name  varchar(10), ij int , charval  varchar(100) )

SET ROWCOUNT 1
insert into #Temp
EXEC master..xp_msver  Language
select * from #temp
DROP TABLE #temp
0
 
LVL 11

Author Comment

by:SweatCoder
ID: 17868764
Invalid object name '#temp'.

I was thinking SELECT INTO because that auto-creates the table.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17868794
SweatCoder,
> Invalid object name '#temp'.

Did you include the first "Creata table " statement also

> I was thinking SELECT INTO because that auto-creates the table.

You can't do this, you need to create the table first
0
 
LVL 11

Author Comment

by:SweatCoder
ID: 17868816
Sorry, I had missed the 1st line, was in a hurry. :-)
Works great.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

758 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

18 Experts available now in Live!

Get 1:1 Help Now