用命令创建数据库的语句与图形创建数据库的方法

  • Post author:
  • Post category:其他


创建一个名为“test2008”的数据库

CREATE DATABASE [test2008] ON  PRIMARY

( NAME = N’test2008′, FILENAME = N’H:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLWQQ\MSSQL\DATA\test2008.mdf’ , SIZE = 3072KB , FILEGROWTH = 1024KB )

LOG ON

( NAME = N’test2008_log’, FILENAME = N’H:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLWQQ\MSSQL\DATA\test2008_log.ldf’ , SIZE = 1024KB , FILEGROWTH = 10%)

GO

ALTER DATABASE [test2008] SET COMPATIBILITY_LEVEL = 100

GO

ALTER DATABASE [test2008] SET ANSI_NULL_DEFAULT OFF

GO

ALTER DATABASE [test2008] SET ANSI_NULLS OFF

GO

ALTER DATABASE [test2008] SET ANSI_PADDING OFF

GO

ALTER DATABASE [test2008] SET ANSI_WARNINGS OFF

GO

ALTER DATABASE [test2008] SET ARITHABORT OFF

GO

ALTER DATABASE [test2008] SET AUTO_CLOSE OFF

GO

ALTER DATABASE [test2008] SET AUTO_CREATE_STATISTICS ON

GO

ALTER DATABASE [test2008] SET AUTO_SHRINK OFF

GO

ALTER DATABASE [test2008] SET AUTO_UPDATE_STATISTICS ON

GO

ALTER DATABASE [test2008] SET CURSOR_CLOSE_ON_COMMIT OFF

GO

ALTER DATABASE [test2008] SET CURSOR_DEFAULT  GLOBAL

GO

ALTER DATABASE [test2008] SET CONCAT_NULL_YIELDS_NULL OFF

GO

ALTER DATABASE [test2008] SET NUMERIC_ROUNDABORT OFF

GO

ALTER DATABASE [test2008] SET QUOTED_IDENTIFIER OFF

GO

ALTER DATABASE [test2008] SET RECURSIVE_TRIGGERS OFF

GO

ALTER DATABASE [test2008] SET  DISABLE_BROKER

GO

ALTER DATABASE [test2008] SET AUTO_UPDATE_STATISTICS_ASYNC OFF

GO

ALTER DATABASE [test2008] SET DATE_CORRELATION_OPTIMIZATION OFF

GO

ALTER DATABASE [test2008] SET PARAMETERIZATION SIMPLE

GO

ALTER DATABASE [test2008] SET  READ_WRITE

GO

ALTER DATABASE [test2008] SET RECOVERY FULL

GO

ALTER DATABASE [test2008] SET  MULTI_USER

GO

ALTER DATABASE [test2008] SET PAGE_VERIFY CHECKSUM

GO

USE [test2008]

GO

IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N’PRIMARY’) ALTER DATABASE [test2008] MODIFY FILEGROUP [PRIMARY] DEFAULT

GO

下面是用图形创建数据库:


9266282_200901301313091.jpg


fj.png
未命名3.JPG

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9266282/viewspace-544791/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9266282/viewspace-544791/