Declare @nCount As Int, @str As NVarChar(500), @tablename as varchar(30)
Set @tablename = 'sysusers'
Set @str = 'Select @nCount = Count(*) From ' + @tablename
Exec sp_ExecuteSql @str, N'@nCount Int Out', @nCount Out
select @nCount AS OutVal
This page was last updated on May 01, 2006 04:28 PM.