今天做sql server
/*
** CREABASE
**
** Drop and Rereate the credit database
*/
GO
USE master
SET nocount ON
GO
IF db_id(
DROP DATABASE credit
GO
CREATE DATABASE [credit]
ON PRIMARY (NAME = N
FILENAME = N
SIZE =
FILEGROWTH =
LOG ON (NAME = N
FILENAME = N
SIZE =
FILEGROWTH =
GO
ALTER DATABASE credit
ADD FILEGROUP CreditTablesFG
GO
ALTER DATABASE credit
ADD FILEGROUP CreditIndexesFG
GO
ALTER DATABASE credit
ADD FILE (
NAME = CreditTables
FILENAME =
SIZE =
MAXSIZE = UNLIMITED
FILEGROWTH =
TO FILEGROUP CreditTablesFG
ALTER DATABASE credit
ADD FILE (
NAME = CreditIndexes
FILENAME =
SIZE =
MAXSIZE = UNLIMITED
FILEGROWTH =
TO FILEGROUP CreditIndexesFG
GO
IF db_id(
ELSE
GO
/*
** This script sets the database recovery model to SIMPLE
** for the ClassNorthwind database
** the database to be recovered to the most recent backup
**
** Look under the status column of your sp_helpdb results to
** view the recovery model that has been set for a database
*/
USE ClassNorthwind
ALTER DATABASE ClassNorthwind SET RECOVERY SIMPLE
EXEC sp_helpdb ClassNorthwind
GO
/*
This script modifies the maximum size of the ClassNorthwind transaction log file
and increases its current size
*/
USE master
GO
ALTER DATABASE ClassNorthwind
MODIFY FILE (NAME=
MAXSIZE=
GO
ALTER DATABASE ClassNorthwind
MODIFY FILE (NAME=
SIZE=
GO
ALTER DATABASE ClassNorthwind
MODIFY FILE (NAME=
FILEGROWTH=
GO
EXEC sp_helpdb ClassNorthwind
GO
From:http://tw.wingwit.com/Article/program/SQLServer/201311/22096.html