hgh.just.hony
پنج شنبه 18 خرداد 1391, 09:55 صبح
سلام
من این دو را با هم در اسکریپت زیر ترکیب کردم اما جواب نمیده
:
alter PROCEDURE usp_display_PrdIMG_random
-- Add the parameters for the stored procedure here
@cmpId bigint
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
select dbo._Product.Prd_Id , dbo._Product.Prd_Image , dbo._Product.Prd_Name
from dbo._Product
where Cmp_Id = @cmpId
group by dbo._Product.Prd_Priority
order by dbo._Product.Prd_Priority asc
END
GO
هر دفعه یه جور خطا میده
انگار قاطیه
دیتابیسم 2005
اینم خطا :
Msg 8120, Level 16, State 1, Procedure usp_display_PrdIMG_random, Line 16
Column 'dbo._Product.Prd_Id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
اما اخه این ستون چه ربطی داره؟؟؟ نمی فهمم؟؟؟؟:اشتباه::متفکر::متف ر::متفکر:
من این دو را با هم در اسکریپت زیر ترکیب کردم اما جواب نمیده
:
alter PROCEDURE usp_display_PrdIMG_random
-- Add the parameters for the stored procedure here
@cmpId bigint
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
select dbo._Product.Prd_Id , dbo._Product.Prd_Image , dbo._Product.Prd_Name
from dbo._Product
where Cmp_Id = @cmpId
group by dbo._Product.Prd_Priority
order by dbo._Product.Prd_Priority asc
END
GO
هر دفعه یه جور خطا میده
انگار قاطیه
دیتابیسم 2005
اینم خطا :
Msg 8120, Level 16, State 1, Procedure usp_display_PrdIMG_random, Line 16
Column 'dbo._Product.Prd_Id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
اما اخه این ستون چه ربطی داره؟؟؟ نمی فهمم؟؟؟؟:اشتباه::متفکر::متف ر::متفکر: