SELECT query and then use of @RowCount
From: chequerm (chequerm_at_discussions.microsoft.com)
Date: 09/22/04
- Next message: hari: "format a numeric values with commas"
- Previous message: hari: "format a numeric values with commas"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Sep 2004 21:53:05 -0700
I have the following stored procedure which never fires the raiserror
condition. Even if I place an incorrect state in the proc after the select
state such as (SELECT * from tbl_foo) it still returns the recordset without
an error. The calling command is as follows
(SQLDataReader) reader = SQLServer.ExecuteReader(Me.connectionString, sp,
id)
Note: When executed in the query analyzer the error is displayed. Any help
appreciated.
-----------------------------------------------
CREATE PROCEDURE usp_GetArticle
@ArticleId int
AS
SELECT * FROM tbl_Article WHERE ArticleID = @ArticleId
IF @@RowCount = 0
RAISERROR('RES_RecordNotFound', 18, 1)
-------------------------------------------------
- Next message: hari: "format a numeric values with commas"
- Previous message: hari: "format a numeric values with commas"
- Messages sorted by: [ date ] [ thread ]