将列传递给临时表

时间:2014-05-20 21:17:37

标签: sql-server-2008 stored-procedures temp-tables

我有一个存储过程:

/* data from the Users table*/
create procedure sp_recovery_name_Users
(                                
  @i_id_cod int,
  @u_name varchar(50) = null out
)
AS 
   select
      @u_name = name
   from 
      User
   where 
      cod = @i_id_cuenta

   if (@@rowcount != 1 OR @@error != 0)
      return 8

   return 0
go

如何将存储过程的列传递给临时表?

/*not working*/
create table #temp
(
   t_nombre varchar(50)
)

insert into #temp
  exec sp_recovery_name_Users

0 个答案:

没有答案