Count(*) and Like
From: kk (anonymous_at_discussions.microsoft.com)
Date: 07/26/04
- Next message: Hari Prasad: "Re: Count(*) and Like"
- Previous message: Hari Prasad: "Re: time"
- Next in thread: Hari Prasad: "Re: Count(*) and Like"
- Reply: Hari Prasad: "Re: Count(*) and Like"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Jul 2004 04:34:47 -0700
I have a SQL statement like the below listed inside a
stored procedure.
-------------------------------
declare @cnt int
declare name varchar(250)
set @name = 'aaa'
Select @cnt = count(*) from table1
where name like @name + '%'
select @cnt
--------------------------------
@cnt is always zero, irrespective of how I change the
query even though I have more than one row in that
table corresponding to the Like.
The same statement works fine from the query analyzer.
Please advise.
- Next message: Hari Prasad: "Re: Count(*) and Like"
- Previous message: Hari Prasad: "Re: time"
- Next in thread: Hari Prasad: "Re: Count(*) and Like"
- Reply: Hari Prasad: "Re: Count(*) and Like"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|