May 24, 2014 at 5:22 am
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.
May 24, 2014 at 7:07 pm
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.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply