Im very new to ASP and SQL so sorry if my post sounds dumb. Im trying to create a stored procedure to count how many rows are in a table. I have searched the net and this is what I came up with;
CREATE PROCEDURE SP_Count
SELECT COUNT(*) FROM tbl_Items
END
... and this is the error im getting;
Msg 156, Level 15, State 1, Procedure SP_Count, Line 5
Incorrect syntax near the keyword 'SELECT'.
Msg 102, Level 15, State 1, Procedure SP_Count, Line 7
Incorrect syntax near 'END'.
Question
Jonny Wright
Hi,
Im very new to ASP and SQL so sorry if my post sounds dumb. Im trying to create a stored procedure to count how many rows are in a table. I have searched the net and this is what I came up with;
... and this is the error im getting;
Any ideas? Thanks
Link to comment
Share on other sites
6 answers to this question
Recommended Posts