Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Documention


Documention

Author
Message
Jpotucek
Jpotucek
Right there with Babe
Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)

Group: General Forum Members
Points: 790 Visits: 1648
trying to come up with a few commands that I can use to query my SQL Server 2000 Instances and Document my Databases - preferably Excel

exec sp_helpdb comes to mind.. can anyone help me further?



allen davidson
allen davidson
Old Hand
Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)Old Hand (388 reputation)

Group: General Forum Members
Points: 388 Visits: 852
This script is pretty good.

http://www.sqlservercentral.com/scripts/Miscellaneous/31574/
Jpotucek
Jpotucek
Right there with Babe
Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)

Group: General Forum Members
Points: 790 Visits: 1648
Thanks but I got some crazy HTML output that really isn't very usefull to me..



Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45145 Visits: 39923
Jpotucek (11/28/2007)

trying to come up with a few commands that I can use to query my SQL Server 2000 Instances and Document my Databases - preferably Excel

exec sp_helpdb comes to mind.. can anyone help me further?


Does sp_HelpDB give you all of the information you want?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Jpotucek
Jpotucek
Right there with Babe
Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)Right there with Babe (790 reputation)

Group: General Forum Members
Points: 790 Visits: 1648
Yes, I have been using sp_helpdb databasename. this gives me DB name, logical DB name, physical file locations, size, owner.....

From there I am able to cut and paste what I need into excel but it's tedious...



Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45145 Visits: 39923
Trying to figure out what you need and this seems simple to you because you know what you want... but we don't...

You say the copy/paste into Excel is tedious... what is it about it that's tedious? Do you need to split the Status column or are you trying to paste the output exactly like it is or what?

Are you using the grid mode for the copy paste or the text mode?

Please help us help you... be a bit more descriptive as to what you'd like to get from sp_HelpDB into Excel.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Key DBA
Key DBA
Mr or Mrs. 500
Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)

Group: General Forum Members
Points: 537 Visits: 655
J,

I use this to keep track of the Version and Edition on all of our SQL Server systems.

Written for use in both SQL Server 2000 and SQL Server 2005!

Happy Coding!

-- Show information about all SQL Server Databases in a given instance.

-- SQL Server 2000
USE master
GO

select
-- getdate() as 'Time_Data_Gathered'
--,
cast(serverproperty('ServerName') as varchar(20)) as [Server Name]
,Case when serverproperty('InstanceName') is null
then '(default)'
else serverproperty('InstanceName')
end as [Instance Name]
,name as [Database Name]
,cast(serverproperty('productversion') as varchar(20)) as [Product Version]
,cast(serverproperty('productlevel') as varchar(20)) as [Product Level]
,cast(serverproperty('edition') as varchar(40)) as [Edition]
FROM dbo.sysdatabases



-- SQL Server 2005
USE master
GO

select
-- getdate() as 'Time_Data_Gathered'
--,
cast(serverproperty('ServerName') as varchar(20)) as [Server Name]
,Case when serverproperty('InstanceName') is null
then '(default)'
else serverproperty('InstanceName')
end as [Instance Name]
,name as [Database Name]
,cast(serverproperty('productversion') as varchar(20)) as [Product Version]
,cast(serverproperty('productlevel') as varchar(20)) as [Product Level]
,cast(serverproperty('edition') as varchar(40)) as [Edition]
FROM sys.databases

"Key"
MCITP: DBA, MCSE, MCTS: SQL 2005, OCP
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45145 Visits: 39923
Jpotucek,

C'mon... I'm trying to help... I need the answers to the questions I asked above so we can avoid the problems you're having...

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Steve Jones
Steve Jones
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36156 Visits: 18751
Documenting is hard, often because there's no good place to keep documentation handy. I prefer ER diagrams, but you really need some snippets from Word or someplace handy to note what columns mean. And it should be something that links together related columns.

I've tried Word, Excel, Visio, ER/Studio, ErWin, HTML and more over the years. The only thing that's ever worked well for documenting the database is my brain loaded with experience in working with the tables.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Key DBA
Key DBA
Mr or Mrs. 500
Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)Mr or Mrs. 500 (537 reputation)

Group: General Forum Members
Points: 537 Visits: 655
J,

Can you provide us the column list of the spreadsheet system you currently are using?


In my environment, I use a mix of built-in procedures like sp_helpdb and the custom script (as well as others) that I posted above to populate 2 Excel spreadsheets. One tracks at the server/instance level, and the second one at the database level.

Each document gets a review at least once a month, or when a new database server is being brought online, when a new SQL patch is released. etc.

These spreadsheets come in real handy when my boss gives asks me to get him numbers for his next meeting (oh yeah, it is in 5 minutes) and wants a count of how many SQL 2000 instances we have on Windows 2003 or how many SQL Server 2005 databases we have currently running on SQL Server Service Pack 2.


I would be interested in comparing the information I track with you as well as others.

"Key"
MCITP: DBA, MCSE, MCTS: SQL 2005, OCP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search