Hi everybody
How to return a value like that
I dont want to use Stored proc.
Thanks
DECLARE @.cpt as integer
DECLARE @.pTable as varchar(40)
Select @.pTable = 'Salaires'
SELECT @.cpt = EXEC('Select Count(*) FROM ' + @.pTable)
Print @.cptdeclare @.i int
declare @.sql nvarchar(1000)
select @.sql = 'Select @.i = Count(*) FROM ' + @.pTable
exec sp_executesql @.sql, N'@.i int out', @.i out
select @.i
see
http://www.nigelrivett.net/sp_executeSQL.html
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment