Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have created a stored procedure which select some value, create a temp table and store the select value into the temp table and finally drop that temp table.
This above stored procedure works fine when i am running this in my local sql server but the problem arise when i am trying this on web.
The stored procedure unable to create and drop that temp table.

So can anyone please tell me how to solve this issue?
Thanks in advance.
Posted
Comments
Sandeep Mewara 18-Jul-12 13:13pm    
The stored procedure unable to create and drop that temp table.
How are we suppose to guess on why this is happening for web and not locally?
sahabiswarup 18-Jul-12 13:30pm    
because when i am trying the stored procedure on my local server i got result; but when the same code runs on server it is showing error.
sahabiswarup 19-Jul-12 0:56am    
Here is the procedure:

create PROCEDURE [dbo].[searchresult]
@PageIndex INT
,@PageSize INT
AS
BEGIN
SET NOCOUNT ON;
SELECT ROW_NUMBER() OVER
(
ORDER BY [id] ASC
)AS RowNumber
,[id]
,[title]
,[type]
,[cost]
,[date]
INTO Results
FROM [test]
SELECT * FROM Results
WHERE RowNumber BETWEEN @PageIndex and (@PageSize+@PageIndex)-1
DROP TABLE Results
END

1 solution

It is probably related to permissions on SQL Server. Make sure the user you are connecting as has create/drop permissions on the database you are connecting to.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900