maharaj.narayanan (5/24/2014)
hi,Needed a small help
select table_name,count(*) into #temp from information.schema.table
which will return the table name and their corresponding row count.
i need this in a store procedure where this information should be inserted into a temp table.
thankyou.
Other than the fact that you don't have the required GROUP BY on that code, what's stopping you from using it in a stored procedure?
If that's ALL that the stored procedure is going to consist of, I wouldn't bother because it's useless then. The Temp Table won't be available outside the stored proc and you really don't want to use a Global Temp Table because that will cause concurrency problems.
--Jeff Moden
Change is inevitable... Change for the better is not.