General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Title:
Attempt at a general counting SP
I'm trying to create a SP that can return a count of rows for a specified table, column and column value. I get an error that states "Must declare the variable @tcTable".
Any ideas?
Doug
Here's the SP ...
CREATE PROCEDURE get_count @tcTable varchar(30), @tcColumn varchar(30), @tnValue integer AS
declare @nCount integer
select @nCount = count(*) from @cTable where @tcColumn = @tnValue
RETURN @nCount
GO
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only