I have done this before, and here is what worked for me:
DECLARE @RecordCount int
SET @RecordCount = SELECT COUNT(COLUMNNAME)
FROM TABLENAME
WHERE CONDITION = SOMETHING
IF @RecordCount > 0
BEGIN
...
I think you are on the right track, however I would use SET instead of
SELECT. HTH
+--------------------------+---------------------------+
| SCOTT VAN VLIET | SBC SERVICES, INC. |
| Senior Analyst | ITO Enterprise Tools |
| Tel: 858.886.3878 | 7337 Trade St. Room 4000 |
| Pgr: 858.536.0070 | San Diego, CA 92121 |
| Email: [EMAIL PROTECTED] | http://www.sbc.com |
+--------------------------+---------------------------+
-----Original Message-----
From: Mario Martinez R. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 12:34 PM
To: CF-Talk
Subject: RecordNum =0
Is that down here correct??
I'm trying to detect is this query does not retrieve
any row.
It does not work for me.
Ideas??
Thanks friends
Mario
SELECT @Count=COUNT(UserName) FROM EkSelfAssRpts
WHERE UserName=@UsernameAux AND
FirstName=@FirstNameAux AND Title=@TitleAux
IF @Count=0
BEGIN
/*Here I put my action if Recornum=0 */
EXEC
_________________________________________________________
Do You Yahoo!?
Informacion de Estados Unidos y America Latina, en Yahoo! Noticias.
Visitanos en http://noticias.espanol.yahoo.com
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists