August 23, 2011 at 7:39 am
I'm trying to enter rowcount, data size and index size as three fields in an excel sheet for all the tables in a database. Does anyone know how to write a formula or a query in an excel sheet to implement this?
Thanks.
August 23, 2011 at 8:54 am
You could write a stored procedure, then have Excel run the sp to load the data, or export from SQL into Excel.
August 23, 2011 at 9:35 am
Hmmm.. I'm not sure if I could do that since I just have read permissions to the database.
August 23, 2011 at 10:31 am
Then you could embed the select statement in Excel and run that instead of the sp.
It's been a while, but I think there's some Excel add-in you need.
August 23, 2011 at 12:01 pm
I believe I could use sp_spaceused but I'm not sure how to put the results in 3 different columns.
August 23, 2011 at 12:04 pm
The best way, IMHO, is to write a view and create and "External Data Source" on the spreadsheet.
--Jeff Moden
Change is inevitable... Change for the better is not.
August 23, 2011 at 2:34 pm
My read permissions won't let me do that.
Would it be possible to write a query to push the results of sp_spaceused into a temp table? If yes, can someone please give an example.
August 23, 2011 at 4:14 pm
sunny.tjk (8/23/2011)
My read permissions won't let me do that.
Why not write a view and submit it to the folks asking you to do the job so they can "promote it to production?"
And, I'm really confused... if you only have "read" permissions, why are you seeking what is typically considered to be data only an administrator would need?
--Jeff Moden
Change is inevitable... Change for the better is not.
August 23, 2011 at 4:24 pm
Here's a query I wrote a long time ago that makes sp_SpaceUsed look pretty lame...
http://www.sqlservercentral.com/Forums/FindPost730149.aspx
--Jeff Moden
Change is inevitable... Change for the better is not.
August 23, 2011 at 10:25 pm
Jeff Moden (8/23/2011)
sunny.tjk (8/23/2011)
My read permissions won't let me do that.Why not write a view and submit it to the folks asking you to do the job so they can "promote it to production?"
And, I'm really confused... if you only have "read" permissions, why are you seeking what is typically considered to be data only an administrator would need?
I can only say that my client's environment is very confusing. They hired me to help the production DBAs in migration.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply