Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 subquery question

Author  Topic 

moramoga
Starting Member

34 Posts

Posted - 2006-12-05 : 17:52:48
Create procedure includeList @idPerfil varchar(20), @idPantalla varchar(20) as
begin tran

declare @idAccion varchar(20)

set @idAccion =(select idAccion from TableAccionXPantalla where idPantalla = @idPantalla)

insert into TableAccionXPantallaXPerfil
values (@idPerfil,@idPantalla,@idAccion)

The problem is that the subquery return more than one value and I need all the values, to insert them into TableAccionXPantallaXPerfil

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2006-12-05 : 19:13:26
how about:

insert into TableAccionXPantallaXPerfil
select @idPerfil, @idPantalla, idAccion
from TableAccionXPantalla
where idPantalla = @idPantalla



SqlSpec: a fast and comprehensive data dictionary generator for
SQL Server 2000/2005, Analysis Server 2005, Access 97/2000/XP/2003
http://www.elsasoft.org
Go to Top of Page
   

- Advertisement -