Showing posts with label attached. Show all posts
Showing posts with label attached. Show all posts

Wednesday, March 21, 2012

How to find the size of all databases at once

Hi everyone.

I'm very new to SQL and need to move databases from an old server to a new one that is attached to a SAN. I'm trying to plan LUN sizes.

Is there a way to show the sizes of all databases on the server at once?

Thank you.

Try running the following: "exec sp_helpdb". This will give you the size in megabytes of each database. If you pass the database name to sp_helpdb you will get file level information which may assist in your planning. Thanks.

|||

When I execute this command I get this error:

Msg 515, Level 16, State 2, Procedure sp_helpdb, Line 53

Cannot insert the value NULL into column '', table ''; column does not allow nulls. INSERT fails.

The statement has been terminated.

Do I need to add something else?

|||

It seems that one of the databases does not have an owner. Check the following link:

http://www.fogcreek.com/FogBugz/KB/errors/CannotinsertthevalueNULLi.html

I hope this solves your problem.

Best regards,

Sami Samir

Monday, March 19, 2012

How to find the database version

I detached a database from an SQL server V7 ,
then attached it to an sql server V8 (no migretion)
Runing sp_helpdb shows Version=539 and compatibility_level 80 for all
databases.How can I see tha my databse is actually a V7 version ?
Thanks
When you attach an SQL Server 7.0 database to SQL Server 2000, that database
automatically gets upgraded to SQL Server 2000.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"and" <and@.discussions.microsoft.com> wrote in message
news:40EA21A1-45E9-4282-9037-FEEC90B53F7E@.microsoft.com...
I detached a database from an SQL server V7 ,
then attached it to an sql server V8 (no migretion)
Runing sp_helpdb shows Version=539 and compatibility_level 80 for all
databases.How can I see tha my databse is actually a V7 version ?
Thanks
|||When you attached it, you should have seen messages noting it was upgraded.
It is now a SQL 2000 database.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"and" <and@.discussions.microsoft.com> wrote in message
news:40EA21A1-45E9-4282-9037-FEEC90B53F7E@.microsoft.com...
> I detached a database from an SQL server V7 ,
> then attached it to an sql server V8 (no migretion)
> Runing sp_helpdb shows Version=539 and compatibility_level 80 for all
> databases.How can I see tha my databse is actually a V7 version ?
> Thanks
|||Hi,
You can get the database version by running the below command from Query
Analyzer:-
sp_helpdb <dbname>
See the "compatibility_level " in the result.
FYI, While you attach the database in Query analyzer you can see messages
stating that datbase is getting upgraded.
Thanks
Hari
MCDBA
"and" <and@.discussions.microsoft.com> wrote in message
news:40EA21A1-45E9-4282-9037-FEEC90B53F7E@.microsoft.com...
> I detached a database from an SQL server V7 ,
> then attached it to an sql server V8 (no migretion)
> Runing sp_helpdb shows Version=539 and compatibility_level 80 for all
> databases.How can I see tha my databse is actually a V7 version ?
> Thanks