﻿/****** 创建数据库:  Database [LYFZERPDB]  数据库名变量：@DatabaseName@ 数据库路径变量：@DatabasePath@  Script Date: 2015/2/3 ******/
IF NOT EXISTS (SELECT name FROM sys.databases WHERE name = N'@DatabaseName@')
BEGIN
CREATE DATABASE [@DatabaseName@]
 ON  PRIMARY 
( NAME = N'@DatabaseName@_data', FILENAME = N'@DatabasePath@\@DatabaseName@_data.mdf' , SIZE = 16000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 15%)
 LOG ON 
( NAME = N'@DatabaseName@_log', FILENAME = N'@DatabasePath@\@DatabaseName@_log.ldf' , SIZE = 6144KB , MAXSIZE = 2048GB , FILEGROWTH = 1024KB )
END

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [@DatabaseName@].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [@DatabaseName@] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [@DatabaseName@] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [@DatabaseName@] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [@DatabaseName@] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [@DatabaseName@] SET ARITHABORT OFF 
GO
ALTER DATABASE [@DatabaseName@] SET AUTO_CLOSE ON 
GO
ALTER DATABASE [@DatabaseName@] SET AUTO_CREATE_STATISTICS ON 
GO
ALTER DATABASE [@DatabaseName@] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [@DatabaseName@] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [@DatabaseName@] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [@DatabaseName@] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [@DatabaseName@] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [@DatabaseName@] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [@DatabaseName@] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [@DatabaseName@] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [@DatabaseName@] SET  DISABLE_BROKER 
GO
ALTER DATABASE [@DatabaseName@] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [@DatabaseName@] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [@DatabaseName@] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [@DatabaseName@] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [@DatabaseName@] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [@DatabaseName@] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [@DatabaseName@] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [@DatabaseName@] SET  MULTI_USER 
GO
ALTER DATABASE [@DatabaseName@] SET PAGE_VERIFY NONE  
GO
ALTER DATABASE [@DatabaseName@] SET DB_CHAINING OFF 
GO
ALTER DATABASE [@DatabaseName@] SET  READ_WRITE
GO