?
Solved

capture xp_msver results into temp table

Posted on 2006-11-03
4
Medium Priority
?
719 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

801 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