- customerordermanagementsystemdemo.zip
- Customer Databases.bak
- CustomerOrderManagementSystem
- Customer Database
- Customer Database.dbmdl
- Customer Database.dbproj
- Data Generation Plans
- Properties
- Database.sqlcmdvars
- Database.sqldeployment
- Database.sqlpermissions
- Database.sqlsettings
- Schema Comparisons
- Schema Objects
- Database Level Objects
- Assemblies
- Database Triggers
- Security
- Asymmetric Keys
- Certificates
- Master Keys
- Roles
- Application Roles
- Database Roles
- Schemas
- Signatures
- Symmetric Keys
- Users
- Service Broker
- Contracts
- Event Notifications
- Message Types
- Remote Service Binding
- Routes
- Services
- Storage
- Filegroups
- Files
- Full Text Catalogs
- Partition Functions
- Partition Schemes
- Schemas
- dbo
- Programmability
- Defaults
- Functions
- Rules
- Stored Procedures
- Types
- User Defined Data Types
- User Defined Types CLR
- XML Schema Collections
- Service Broker
- Queues
- Synonyms
- Tables
- Views
- Indexes
- Statistics
- Triggers
- Scripts
- Post-Deployment
- Pre-Deployment
- sql
- debug
- release
- CustomerOrderManagementSystem.sln
- CustomerOrderManagementSystemDEM
- ServiceLibraries.CustomerServiceLibrary
- TestClient
|
/*
Deployment script for Customer Database
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
GO
:setvar DatabaseName "Customer Database"
:setvar DefaultDataPath "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\"
:setvar DefaultLogPath "c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\"
GO
USE [master]
GO
:on error exit
GO
IF (DB_ID(N'$(DatabaseName)') IS NOT NULL
AND DATABASEPROPERTYEX(N'$(DatabaseName)','Status') <> N'ONLINE')
BEGIN
RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127,N'$(DatabaseName)') WITH NOWAIT
RETURN
END
GO
IF NOT EXISTS (SELECT 1 FROM [master].[dbo].[sysdatabases] WHERE [name] = N'$(DatabaseName)')
BEGIN
RAISERROR(N'You cannot deploy this update script to target IN09PC76-PC\SQLEXPRESS. The database for which this script was built, Customer Database, does not exist on this server.', 16, 127) WITH NOWAIT
RETURN
END
GO
IF (@@servername != 'IN09PC76-PC\SQLEXPRESS')
BEGIN
RAISERROR(N'The server name in the build script %s does not match the name of the target server %s. Verify whether your database project settings are correct and whether your build script is up to date.', 16, 127,N'IN09PC76-PC\SQLEXPRESS',@@servername) WITH NOWAIT
RETURN
END
GO
IF CAST(DATABASEPROPERTY(N'$(DatabaseName)','IsReadOnly') as bit) = 1
BEGIN
RAISERROR(N'You cannot deploy this update script because the database for which it was built, %s , is set to READ_ONLY.', 16, 127, N'$(DatabaseName)') WITH NOWAIT
RETURN
END
GO
USE [$(DatabaseName)]
GO
/*
Pre-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be executed before the build script.
Use SQLCMD syntax to include a file in the pre-deployment script.
Example: :r .\myfile.sql
Use SQLCMD syntax to reference a variable in the pre-deployment script.
Example: :setvar TableName MyTable
SELECT * FROM [$(TableName)]
--------------------------------------------------------------------------------------
*/
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)]
--------------------------------------------------------------------------------------
*/
GO
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Venugopal works as a Senior Software Engineer in Logitech Engineering & Design (India) Pvt. Ltd. He hold a Masters in Computer Applications and has 4+ years experience in C#, XAML, Silverlight & WPF.
Venugopal firmly believes "technology is impermanent, change is not"!. While he has strong technical inclination towards MS technologies, he is deeply passionate about pursuing his career in Windows7-WPF and Silverlight Technology.
Venu engages in a wide gamut of temperamental hobbies ranging from making friends, traveling, helping his friends studies. To murmuring songs and watching movies in leisure time.