September 4, 2013 at 1:35 am
hi my friends
create procedure yerde
@phone decimal(18,0),
@unvan nvarchar(200),
@yunvan nvarchar(200),
@Sentar smalldatetime,
@naryadN smallint,
@naryadtar smalldatetime,
@sebebi nvarchar(200)
as
insert yerdeys(
phone ,
unvan ,
yunvan ,
Sentar ,
naryadN ,
naryadtar ,
sebebi
)
select
@phone,
(select top 1 *from phone where phone=@phone),
@yunvan,
@Sentar,
@naryadN,
@naryadtar ,
@sebebi
update phone
set telUnvan=@yunvan
where phone=@phone
---- error
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
September 4, 2013 at 1:44 am
It's getting created successfully without any issue.
September 4, 2013 at 1:48 am
gurbanov.1984 (9/4/2013)
hi my friendscreate procedure yerde
@phone decimal(18,0),
@unvan nvarchar(200),
@yunvan nvarchar(200),
@Sentar smalldatetime,
@naryadN smallint,
@naryadtar smalldatetime,
@sebebi nvarchar(200)
as
insert yerdeys(
phone ,
unvan ,
yunvan ,
Sentar ,
naryadN ,
naryadtar ,
sebebi
)
select
@phone,
(select top 1 *from phone where phone=@phone),
@yunvan,
@Sentar,
@naryadN,
@naryadtar ,
@sebebi
update phone
set telUnvan=@yunvan
where phone=@phone
---- error
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
Inside the SELECT statement you need to specify one single column name instead of using the asterix
create procedure yerde
@....
as
insert yerdeys(
...
)
select
@phone,
(select top 1 {columnname} from phone where phone=@phone),
@yunvan,
...
update phone
set telUnvan=@yunvan
where phone=@phone
September 4, 2013 at 1:49 am
thank you very much
I have not seen
sorry
September 4, 2013 at 1:54 am
no
(select top 1 *from phone where phone=@phone) -- this is not a problem
tO ARTICLE
I corrected
topic is closed
September 4, 2013 at 1:55 am
THANK YOU VERY MUCH
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply