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 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy