capture xp_msver results into temp table

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.
LVL 11
SweatCoderAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
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
 
SweatCoderAuthor Commented:
Invalid object name '#temp'.

I was thinking SELECT INTO because that auto-creates the table.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
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
 
SweatCoderAuthor Commented:
Sorry, I had missed the 1st line, was in a hurry. :-)
Works great.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.