text: ﻿/*
  Deployment script for Books
  
  This code was generated by a tool.
  Changes to this file may cause incorrect behavior and will be lost if
  the code is regenerated.
  */
  
  GO
  SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
  
  SET NUMERIC_ROUNDABORT OFF;
  
  
  GO
  :setvar DatabaseName "Books"
  :setvar DefaultFilePrefix "Books"
  :setvar DefaultDataPath "c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS2012\MSSQL\DATA\"
  :setvar DefaultLogPath "c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS2012\MSSQL\DATA\"
  
  GO
  :on error exit
  GO
  /*
  Detect SQLCMD mode and disable script execution if SQLCMD mode is not supported.
  To re-enable the script after enabling SQLCMD mode, execute the following:
  SET NOEXEC OFF; 
  */
  :setvar __IsSqlCmdEnabled "True"
  GO
  IF N'$(__IsSqlCmdEnabled)' NOT LIKE N'True'
      BEGIN
          PRINT N'SQLCMD mode must be enabled to successfully execute this script.';
          SET NOEXEC ON;
      END
  
  
  GO
  USE [$(DatabaseName)];
  
  
  GO
  PRINT N'Creating [dbo].[Authors]...';
  
  
  GO
  CREATE TABLE [dbo].[Authors] (
      [Id]   INT          IDENTITY (1, 1) NOT NULL,
      [Name] VARCHAR (50) NOT NULL,
      CONSTRAINT [PK_Authors] PRIMARY KEY CLUSTERED ([Id] ASC) ON [PRIMARY]
  ) ON [PRIMARY];
  
  
  GO
  PRINT N'Creating [dbo].[Books]...';
  
  
  GO
  CREATE TABLE [dbo].[Books] (
      [BookId]      INT           IDENTITY (1, 1) NOT NULL,
      [Name]        VARCHAR (50)  NOT NULL,
      [Cover]       VARCHAR (MAX) NULL,
      [PublishDate] DATE          NOT NULL,
      [AuthorId]    INT           NOT NULL,
      CONSTRAINT [PK_Books] PRIMARY KEY CLUSTERED ([BookId] ASC) ON [PRIMARY]
  ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY];
  
  
  GO
  PRINT N'Creating [dbo].[Users]...';
  
  
  GO
  CREATE TABLE [dbo].[Users] (
      [Id]       INT          IDENTITY (1, 1) NOT NULL,
      [Username] VARCHAR (50) NOT NULL,
      [Password] VARCHAR (50) NOT NULL,
      [Age]      INT          NOT NULL,
      CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED ([Id] ASC) ON [PRIMARY]
  ) ON [PRIMARY];
  
  
  GO
  /*
  Post-Deployment Script Template							
  --------------------------------------------------------------------------------------
   This file contains SQL statements that will be appended to the build script.		
   Use SQLCMD syntax to include a file in the post-deployment script.			
   Example:      :r .\myfile.sql								
   Use SQLCMD syntax to reference a variable in the post-deployment script.		
   Example:      :setvar TableName MyTable							
                 SELECT * FROM [$(TableName)]					
  --------------------------------------------------------------------------------------
  */
  
  DROP TABLE [dbo].[Authors]
  
  SET IDENTITY_INSERT [dbo].[Authors] ON 
  GO
  INSERT [dbo].[Authors] ([Id], [Name]) VALUES (1, N'Terry Pratchet')
  GO
  INSERT [dbo].[Authors] ([Id], [Name]) VALUES (2, N'J. K. Rowling')
  GO
  INSERT [dbo].[Authors] ([Id], [Name]) VALUES (3, N'J. R. R. Tolken')
  GO
  SET IDENTITY_INSERT [dbo].[Authors] OFF
  GO
  
  GO
  PRINT N'Update complete.';
  
  
  GO
  