Hi,
I have a stored procedure which accepts a start datetime and end datetime as parameters and picks up records from a view and inserts those into another table. And I'm calling this from my VB program. No problem in execution. So far so good. How can I know, how many rows have been inserted by the procedure.
Here is my stored procedure:
CREATE PROCEDURE [SP_HISTORYABNORMALCELLSTATUS] (@insFromDateTime decimal, @insToDateTime decimal) AS
INSERT INTO TBLABNORMALCELLSTATUS(PCUSNID, PCUSA, CONN, PCMLK, P_BVC, PB_STATE, PC_STATE,
P_BUCKETSIZE, P_LEAKRATE, CELLID, PB_INSDATETIME, PC_INSDATETIME, SGSNID, SGGTL, NSEI,
S_BVC, S_STATE, S_BUCKETSIZE, S_LEAKRATE, S_INSDATETIME, BSC, CELLNAME, LOCATIONAREACODE)
SELECT PCUSNID, PCUSA, CONN, PCMLK, P_BVC, PB_STATE, PC_STATE, P_BUCKETSIZE, P_LEAKRATE,
CELLID, PB_INSDATETIME, PC_INSDATETIME, SGSNID, SGGTL, NSEI, S_BVC, S_STATE, S_BUCKETSIZE,
S_LEAKRATE, S_INSDATETIME, BSC, CELLNAME, LOCATIONAREACODE FROM VEWABNORMALCELLSTATUS WHERE
(PB_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime AND S_INSDATETIME IS NULL)
OR
(PB_INSDATETIME IS NULL AND S_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime)
OR
(PB_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime AND
S_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime)
RETURN @@ROWCOUNT
And here is my VB Code to execute the above:
tmpProcText = "EXEC SP_HISTORYABNORMALCELLSTATUS " & insFromDateTime & ", " & insToDateTime
conn.Execute (tmpProcText)
anybody can give me some idea(s)??
Thanks a lot in advance..!!
I have a stored procedure which accepts a start datetime and end datetime as parameters and picks up records from a view and inserts those into another table. And I'm calling this from my VB program. No problem in execution. So far so good. How can I know, how many rows have been inserted by the procedure.
Here is my stored procedure:
CREATE PROCEDURE [SP_HISTORYABNORMALCELLSTATUS] (@insFromDateTime decimal, @insToDateTime decimal) AS
INSERT INTO TBLABNORMALCELLSTATUS(PCUSNID, PCUSA, CONN, PCMLK, P_BVC, PB_STATE, PC_STATE,
P_BUCKETSIZE, P_LEAKRATE, CELLID, PB_INSDATETIME, PC_INSDATETIME, SGSNID, SGGTL, NSEI,
S_BVC, S_STATE, S_BUCKETSIZE, S_LEAKRATE, S_INSDATETIME, BSC, CELLNAME, LOCATIONAREACODE)
SELECT PCUSNID, PCUSA, CONN, PCMLK, P_BVC, PB_STATE, PC_STATE, P_BUCKETSIZE, P_LEAKRATE,
CELLID, PB_INSDATETIME, PC_INSDATETIME, SGSNID, SGGTL, NSEI, S_BVC, S_STATE, S_BUCKETSIZE,
S_LEAKRATE, S_INSDATETIME, BSC, CELLNAME, LOCATIONAREACODE FROM VEWABNORMALCELLSTATUS WHERE
(PB_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime AND S_INSDATETIME IS NULL)
OR
(PB_INSDATETIME IS NULL AND S_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime)
OR
(PB_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime AND
S_INSDATETIME BETWEEN @insFromDateTime AND @insToDateTime)
RETURN @@ROWCOUNT
And here is my VB Code to execute the above:
tmpProcText = "EXEC SP_HISTORYABNORMALCELLSTATUS " & insFromDateTime & ", " & insToDateTime
conn.Execute (tmpProcText)
anybody can give me some idea(s)??
Thanks a lot in advance..!!