用T-SQL语句创建一个“mydb”数据库
用T-SQL语句创建一个“mydb”数据库,数据文件逻辑文件名为“mydb_data1”,物理文件名为“mydb1”,初始尺寸为3MB,不限定最大尺寸,增长量为20%,属...
用T-SQL语句创建一个“mydb”数据库,数据文件逻辑文件名为“mydb_data1”,物理文件名为“mydb1”,初始尺寸为3MB,不限定最大尺寸,增长量为20%,属于主文件组。事务日志逻辑文件名为“mydb_log1”,物理文件名为“mydb_log1”,初始尺寸为1MB,最大尺寸为8MB,增长量为10%。文件全部存储在“D:\sqlbase”路径下。
展开
4个回答
展开全部
CREATE DATABASE mydb
ON PRIMARY
( NAME = mydb_data1,
FILENAME = 'd:\sqlbase\mydb1.mdf',
SIZE = 3MB,
FILEGROWTH = 20% )
LOG ON
( NAME = mydb_log1,
FILENAME = 'd:\sqlbase\mydb_log1.ldf',
SIZE = 1MB,
MAXSIZE = 8MB,
FILEGROWTH = 10% ) ;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-04-23
展开全部
USE [master]
GO
/****** Object: Database [mydb] Script Date: 04/23/2014 16:52:21 ******/
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'mydb')
DROP DATABASE [mydb]
GO
USE [master]
GO
/****** Object: Database [mydb] Script Date: 04/23/2014 16:52:21 ******/
CREATE DATABASE [mydb] ON PRIMARY
( NAME = N'mydb', FILENAME = N'D:\sqlbase\mydb.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 20%)
LOG ON
( NAME = N'mydb_log', FILENAME = N'D:\sqlbase\mydb_log.ldf' , SIZE = 1024KB , MAXSIZE = 8192KB , FILEGROWTH = 10%)
GO
ALTER DATABASE [mydb] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [mydb].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [mydb] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [mydb] SET ANSI_NULLS OFF
GO
ALTER DATABASE [mydb] SET ANSI_PADDING OFF
GO
ALTER DATABASE [mydb] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [mydb] SET ARITHABORT OFF
GO
ALTER DATABASE [mydb] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [mydb] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [mydb] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [mydb] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [mydb] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [mydb] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [mydb] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [mydb] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [mydb] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [mydb] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [mydb] SET DISABLE_BROKER
GO
ALTER DATABASE [mydb] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [mydb] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [mydb] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [mydb] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [mydb] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [mydb] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [mydb] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [mydb] SET READ_WRITE
GO
ALTER DATABASE [mydb] SET RECOVERY FULL
GO
ALTER DATABASE [mydb] SET MULTI_USER
GO
ALTER DATABASE [mydb] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [mydb] SET DB_CHAINING OFF
GO
GO
/****** Object: Database [mydb] Script Date: 04/23/2014 16:52:21 ******/
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'mydb')
DROP DATABASE [mydb]
GO
USE [master]
GO
/****** Object: Database [mydb] Script Date: 04/23/2014 16:52:21 ******/
CREATE DATABASE [mydb] ON PRIMARY
( NAME = N'mydb', FILENAME = N'D:\sqlbase\mydb.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 20%)
LOG ON
( NAME = N'mydb_log', FILENAME = N'D:\sqlbase\mydb_log.ldf' , SIZE = 1024KB , MAXSIZE = 8192KB , FILEGROWTH = 10%)
GO
ALTER DATABASE [mydb] SET COMPATIBILITY_LEVEL = 100
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [mydb].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [mydb] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [mydb] SET ANSI_NULLS OFF
GO
ALTER DATABASE [mydb] SET ANSI_PADDING OFF
GO
ALTER DATABASE [mydb] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [mydb] SET ARITHABORT OFF
GO
ALTER DATABASE [mydb] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [mydb] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [mydb] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [mydb] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [mydb] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [mydb] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [mydb] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [mydb] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [mydb] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [mydb] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [mydb] SET DISABLE_BROKER
GO
ALTER DATABASE [mydb] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [mydb] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [mydb] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [mydb] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [mydb] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [mydb] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [mydb] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [mydb] SET READ_WRITE
GO
ALTER DATABASE [mydb] SET RECOVERY FULL
GO
ALTER DATABASE [mydb] SET MULTI_USER
GO
ALTER DATABASE [mydb] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [mydb] SET DB_CHAINING OFF
GO
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
MySQL云数据库创建、配置与使用教程,五秒钟创建属于自己的mysql云数据库,申请地址:xmjar.cn
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
CREATE DATABASE [mydb] ON PRIMARY
( NAME = N'mydb1', FILENAME = N'D:\sqlbase\mydb.mdf' , SIZE = 3MB , MAXSIZE = UNLIMITED, FILEGROWTH = 20% )
LOG ON
( NAME = N'mydb_log1', FILENAME = N'D:\sqlbase\mydb_log.LDF' , SIZE =1MB , MAXSIZE = 8MB , FILEGROWTH = 10%)
GO
( NAME = N'mydb1', FILENAME = N'D:\sqlbase\mydb.mdf' , SIZE = 3MB , MAXSIZE = UNLIMITED, FILEGROWTH = 20% )
LOG ON
( NAME = N'mydb_log1', FILENAME = N'D:\sqlbase\mydb_log.LDF' , SIZE =1MB , MAXSIZE = 8MB , FILEGROWTH = 10%)
GO
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |