I have a table containing 100 columns and 2,000,000 records. when I retrieve records using a stored procedure, from which sometimes I get "Waiting for a wait." error.When I modify the stored procedure and then try to retrieve the records, it will work fine.
Can someone tell me what is the best solution for this?
SP AS After
CREATE PROC GetProducts @ClientId INT=NULL
AS
BEGIN
SELECT TOP 10 ClientId,
Field2,
Field3,
Field4,
Field5,
Field6,
Field7,
Field8,
Field9,
Field10
FROM ProductMaster
WHERE ClientId = @ClientId
ORDER BY Field1 DESC
END
source
share