Solved

capture xp_msver results into temp table

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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

733 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