總網頁瀏覽量

2013年1月6日 星期日

MS建立資料庫

CREATE DATABASE [YYPDB] ON  PRIMARY
( NAME = N'YYPDB'(這邊的N表示字串採用Unicode), FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\YYPDB.mdf' , SIZE = 10240KB , FILEGROWTH = 1024KB )


 LOG ON
( NAME = N'YYPDB_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\YYPDB_log.ldf' , SIZE = 2048KB , FILEGROWTH = 10%)
GO
ALTER DATABASE [YYPDB] SET COMPATIBILITY_LEVEL = 100
GO
ALTER DATABASE [YYPDB] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [YYPDB] SET ANSI_NULLS OFF
GO
ALTER DATABASE [YYPDB] SET ANSI_PADDING OFF
GO
ALTER DATABASE [YYPDB] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [YYPDB] SET ARITHABORT OFF
GO
ALTER DATABASE [YYPDB] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [YYPDB] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [YYPDB] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [YYPDB] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [YYPDB] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [YYPDB] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [YYPDB] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [YYPDB] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [YYPDB] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [YYPDB] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [YYPDB] SET  DISABLE_BROKER
GO
ALTER DATABASE [YYPDB] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [YYPDB] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [YYPDB] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [YYPDB] SET  READ_WRITE
GO
ALTER DATABASE [YYPDB] SET RECOVERY SIMPLE
GO
ALTER DATABASE [YYPDB] SET  MULTI_USER
GO
ALTER DATABASE [YYPDB] SET PAGE_VERIFY CHECKSUM 
GO
USE [YYPDB]
GO
IF NOT EXISTS (SELECT name FROM sys.filegroups WHERE is_default=1 AND name = N'PRIMARY') ALTER DATABASE [YYPDB] MODIFY FILEGROUP [PRIMARY] DEFAULT
GO

沒有留言:

張貼留言