Solution If your stored procedure i returning just a column or more than 1 columns and not returning the ID column that is the primary key, this error would occur. Just include ID or * in select statement e.g. ALTER PROCEDURE [dbo].[sp_FillMenuItems] AS BEGIN SELECT * from t_Menu End OR ALTER PROCEDURE [dbo].[sp_FillMenuItems] AS BEGIN... Continue Reading →
SQL Query Multiple Columns Using Distinct on One Column Only
Solution select ID, Category from t_Con_ChargesAmount where ID in (Select max(ID) FROM t_Con_ChargesAmount group by Category) Explanation This query will select ID and Category from the table and the Category will be distinct now.