Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Call it like this:
EXEC GetRecordCount 'NASA', @MyNumber OUTPUT
BOb
>><<<snip>>>
>>>>Try this
>>>>
>>>>SET @sqlcmd = 'SELECT [@NumRecs] = COUNT(email)
>>>>FROM ' + @TableName
>>>>WHERE Include = 'Y'
>>>
>>>That certainly works Sergey. However, the PRINT @MyNumber line does not print a value. That means that the value (@NumRecs) was not returned to the calling program properly.
>>
>>I just try it on my SQL Server and it works.
>>What version of SQL Server are you using?
>>My is 7.0
>
>
>I am running 7.0 also. The sql sequence (running from within)Query Analyzer:
>
>DECLARE @MyNumber int
>EXEC GetRecordCount "NASA", @NumRecs = @MyNumber OUTPUT
>PRINT '================'
>PRINT @MyNumber
>
>returns the following:
>
>@NumRecs
>-----------
>105729
>
>(1 row(s) affected)
>
>=================
> <<<<<---- 105729 should print here.
>
>Notice that PRINT @MyNumber returns no value.
>Thanks for your help.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement