在使用T—SQL 语句修改数据库属性,必须指明数据文件什么属性
1个回答
展开全部
你先用mangerment studio弄,在生成个create脚本就好了呀。。。
USE [master]
GO
/****** Object: Database [DBEX] Script Date: 06/19/2014 11:25:12 ******/
CREATE DATABASE [DBEX] ON PRIMARY
( NAME = N'DBEX', FILENAME = N'C:\db\DBEX.mdf' , SIZE = 5120KB , MAXSIZE = 20480KB , FILEGROWTH = 2048KB )
LOG ON
( NAME = N'DBEX_log', FILENAME = N'C:\db\DBEX_log.ldf' , SIZE = 3072KB , MAXSIZE = 2048GB , FILEGROWTH = 20%)
GO
ALTER DATABASE [DBEX] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [DBEX].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [DBEX] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [DBEX] SET ANSI_NULLS OFF
GO
ALTER DATABASE [DBEX] SET ANSI_PADDING OFF
GO
ALTER DATABASE [DBEX] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [DBEX] SET ARITHABORT OFF
GO
ALTER DATABASE [DBEX] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [DBEX] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [DBEX] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [DBEX] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [DBEX] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [DBEX] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [DBEX] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [DBEX] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [DBEX] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [DBEX] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [DBEX] SET DISABLE_BROKER
GO
ALTER DATABASE [DBEX] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [DBEX] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [DBEX] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [DBEX] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [DBEX] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [DBEX] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [DBEX] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [DBEX] SET READ_WRITE
GO
ALTER DATABASE [DBEX] SET RECOVERY FULL
GO
ALTER DATABASE [DBEX] SET MULTI_USER
GO
ALTER DATABASE [DBEX] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [DBEX] SET DB_CHAINING OFF
GO
USE [master]
GO
/****** Object: Database [DBEX] Script Date: 06/19/2014 11:25:12 ******/
CREATE DATABASE [DBEX] ON PRIMARY
( NAME = N'DBEX', FILENAME = N'C:\db\DBEX.mdf' , SIZE = 5120KB , MAXSIZE = 20480KB , FILEGROWTH = 2048KB )
LOG ON
( NAME = N'DBEX_log', FILENAME = N'C:\db\DBEX_log.ldf' , SIZE = 3072KB , MAXSIZE = 2048GB , FILEGROWTH = 20%)
GO
ALTER DATABASE [DBEX] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [DBEX].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [DBEX] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [DBEX] SET ANSI_NULLS OFF
GO
ALTER DATABASE [DBEX] SET ANSI_PADDING OFF
GO
ALTER DATABASE [DBEX] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [DBEX] SET ARITHABORT OFF
GO
ALTER DATABASE [DBEX] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [DBEX] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [DBEX] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [DBEX] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [DBEX] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [DBEX] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [DBEX] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [DBEX] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [DBEX] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [DBEX] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [DBEX] SET DISABLE_BROKER
GO
ALTER DATABASE [DBEX] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [DBEX] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [DBEX] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [DBEX] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [DBEX] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [DBEX] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [DBEX] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [DBEX] SET READ_WRITE
GO
ALTER DATABASE [DBEX] SET RECOVERY FULL
GO
ALTER DATABASE [DBEX] SET MULTI_USER
GO
ALTER DATABASE [DBEX] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [DBEX] SET DB_CHAINING OFF
GO
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询