Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help in a Stored Procedure

Author  Topic 

1sabine8
Posting Yak Master

130 Posts

Posted - 2007-12-12 : 08:57:20
Hi, i have this query in a stored procedure:
SELECT Count(new_coursesyname)as CountExCourtesy
FROM dbo.FilteredNew_CommentCard
Where new_courtesy = 'Excellent'

I need to declare a variable and to set its value equal to CountExCourtesy. How can i do it? What the right syntax?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-12-12 : 09:01:44
[code]DECLARE @CountExCourtesy int

SELECT @CountExCourtesy = COUNT(new_coursesyname) AS CountExCourtesy
FROM dbo.FilteredNew_CommentCard
WHERE new_courtesy = 'Excellent'[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -