Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: how do i return a count(*)


Message #1 by snehabandakavi@s... on Tue, 13 Feb 2001 21:57:02 GMT
hi all,
how do i return a count(*) with a dynamic database name into a variable.

for eg.
declare @cnt int

select @cnt='select count(*) from ['+@dbname'+].dbo.titles'
here select statement is stored into the variable
when executed I do get the number but i need to store that number

Thanks
Sneha

  Return to Index