Solved

capture xp_msver results into temp table

Posted on 2006-11-03
4
708 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

911 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

23 Experts available now in Live!

Get 1:1 Help Now