SQL如何导出简化的脚本
我使用以下脚本创建了数据库create database Store
go
use Store
go
create table Goods
(
Id int not null primary key,--编号
Name Varchar(20) not null,--名称
Price Decimal(5,2) not null,--价格
Demo Varchar(100)--备注
)
insert Goods values(1,'啤酒',3.00,null)
insert Goods values(2,'软中华',70.00,'软中华就是比硬中华贵')
insert Goods values(3,'康师傅矿泉水',1.00,null)
insert Goods values(4,'北京方便面',1.00,'童年的回忆')
insert Goods values(5,'农夫山泉',2.00,null)
insert Goods values(6,'统一方便面(桶)',5.00,null)
但使用生成脚本功能生成的代码太过复杂
USE
GO
/****** Object:Database Script Date: 2020/5/23 21:47:37 ******/
CREATE DATABASE
CONTAINMENT = NONE
ONPRIMARY
( NAME = N'Store', FILENAME = N'C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\Store.mdf' , SIZE = 4160KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'Store_log', FILENAME = N'C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\Store_log.ldf' , SIZE = 1040KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC .. @ACTION = 'enable'
end
GO
ALTER DATABASE SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE SET ANSI_NULLS OFF
GO
ALTER DATABASE SET ANSI_PADDING OFF
GO
ALTER DATABASE SET ANSI_WARNINGS OFF
GO
ALTER DATABASE SET ARITHABORT OFF
GO
ALTER DATABASE SET AUTO_CLOSE ON
GO
ALTER DATABASE SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE SET AUTO_SHRINK OFF
GO
ALTER DATABASE SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE SET CURSOR_DEFAULTGLOBAL
GO
ALTER DATABASE SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE SETENABLE_BROKER
GO
ALTER DATABASE SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE SET TRUSTWORTHY OFF
GO
ALTER DATABASE SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE SET RECOVERY SIMPLE
GO
ALTER DATABASE SETMULTI_USER
GO
ALTER DATABASE SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE SET DB_CHAINING OFF
GO
ALTER DATABASE SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE SET TARGET_RECOVERY_TIME = 0 SECONDS
GO
USE
GO
/****** Object:Table . Script Date: 2020/5/23 21:47:37 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE .(
NOT NULL,
(20) NOT NULL,
(5, 2) NOT NULL,
(100) NULL,
PRIMARY KEY CLUSTERED
(
ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON
) ON
GO
SET ANSI_PADDING OFF
GO
USE
GO
ALTER DATABASE SETREAD_WRITE
GO
请问如何快速生成较为简洁的SQL脚本?
页:
[1]