Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Expend all DBs
I support a server that has over 200 databases on 1 instance.  Each database
is about 2 megs.  Does anyone know how I can automate a script that will
increase the size to 500 megs for ALL DBs.  I want to run this script during
the evening hours.

Ishu



Report this thread to moderator Post Follow-up to this message
Old Post
Tim
05-31-05 02:23 PM


Re: Expend all DBs
"Tim" <tim@nospam.com> wrote in message
news:Er_me.6218$sm1.512@news.cpqcorp.net...
> I support a server that has over 200 databases on 1 instance.  Each
 database
> is about 2 megs.  Does anyone know how I can automate a script that will
> increase the size to 500 megs for ALL DBs.  I want to run this script
 during
> the evening hours.
>
> Ishu
>
>

First off, do you have enough storage to do this?  That's about 1 terabyte
if my math is correct.

You could use dynamic SQL to do this.

Select the database name from master.dbo.sysdatabases into a cursor.  For
each non-system database, run the ALTER DATABASE command and reset your
sizes.


Rick Sawtell
MCT, MCSD, MCDBA







Report this thread to moderator Post Follow-up to this message
Old Post
Rick Sawtell
05-31-05 04:23 PM


RE: Expend all DBs
There are couple of ways.
You can create a cursor where you will get
list of databases you need to expand
and then inside cursor use dynamic SQL to
run ALTER DATABASE against each DB.

Another way for example to run a script
that will generate another SQL script with names of DBs in there

Something like

select 'ALTER DATABASE '+name+'...' from master..sysdatabases where ... --
make sure you will exclude system databases fom there

Then execute result script to expand databases.
This way is good as a one time deal.


Regards.

"Tim" wrote:

> I support a server that has over 200 databases on 1 instance.  Each databa
se
> is about 2 megs.  Does anyone know how I can automate a script that will
> increase the size to 500 megs for ALL DBs.  I want to run this script duri
ng
> the evening hours.
>
> Ishu
>
>
>

Report this thread to moderator Post Follow-up to this message
Old Post
SkyWalker
06-01-05 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 11:49 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006