Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select into a variable

Status
Not open for further replies.

iamtechuser

IS-IT--Management
Jun 18, 2008
18
US
Hi

I need to select into a variable:

Code:
insert into #tmp EXEC @result = master..xp_cmdshell @cmd

IF (@result <> 0) -- return value from xp_cmdshell, 0 = success, 1 = failure
  BEGIN
	SELECT @output = result FROM #tmp

But @output is empty... but #tmp is not.

Help, how can I capture row data from #tmp into a variable?

Thanks
 
Are you sure @output is empty? Have you tried adding :
Code:
SELECT @output
 
Please don't post the same problem twice. It won't get you an answer any faster.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top