Records not returned with where clause
Hi,
I am creating a temporary table into which I am passing data from a table so as to page through the results, if I removed the where clause all values are returned but if I add a where clause then no records are returned?
I have run the query in sql and it works fine, I have done a response.write within the asp code so I know the value is being passed into the procedure parameter, the problem is it is as if it is getting lost somewhere during the procedure.
This is the stored procedure:
CREATE TABLE #CILTempItems
(
myID INT IDENTITY,
row_id INT,
NETWORK_ID VARCHAR(3),
NODE_ID VARCHAR(5),
CORP_ID VARCHAR(10),
EMP_ID VARCHAR(10),
CIL_ID VARCHAR(20),
CIL_TYPE VARCHAR(1),
CIL_KEY VARCHAR(10),
CIL_DESC VARCHAR(20),
CIL_BILL_FLAG VARCHAR(1),
RENTAL VARCHAR(1),
START_DATE datetime,
END_DATE datetime,
username VARCHAR(50),
action_date datetime,
user_action CHAR(1)
)
-- Insert the rows from tblItems into the temp. table
INSERT INTO #CILTempItems (row_id,NETWORK_ID,NODE_ID,CORP_ID,EMP_ID,CIL_ID,C IL_TYPE,CIL_KEY,CIL_DESC,CIL_BILL_FLAG,RENTAL,STAR T_DATE,END_DATE,username,action_date,user_action)
SELECT* FROM Employee_CIL WHERE NETWORK_ID = @NID
and this is the code in the asp page:
strSQL = "dbo.employee_cil_page " & currentPage & "," & iRecordsPerPage & "," & request("nid") & "," & request("cid") & "," & request("emp")
objRS.Open strSQL, objConn
As I say it works fine without the where clause so maybe the problem lies in trying to use it on a temp table.
Thanks for any help
Peter
|