rules update

This commit is contained in:
2011-03-24 22:46:20 +02:00
parent 8565c16206
commit b566cae92d
18 changed files with 2 additions and 774 deletions
+2
View File
@@ -3,3 +3,5 @@ syntax: glob
*/bin/*
*.user
*/obj/*
*_ReSharper*
*/Bin/*
Binary file not shown.
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DataSchemaModel FileFormatVersion="1.2" SchemaVersion="1.1" DspName="Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider" CollationLcid="1033" CollationCaseSensitive="False">
<Header>
<CustomData Category="ModelCapability">
<Metadata Name="ModelCapability" Value="Default" />
</CustomData>
<CustomData Category="ClrTypesDbSchema" Type="DbSchema">
<Metadata Name="ClrTypesDbSchema" Value="True" />
</CustomData>
<CustomData Category="AnsiNulls">
<Metadata Name="AnsiNulls" Value="True" />
</CustomData>
<CustomData Category="QuotedIdentifier">
<Metadata Name="QuotedIdentifier" Value="True" />
</CustomData>
<CustomData Category="CompatibilityMode">
<Metadata Name="CompatibilityMode" Value="100" />
</CustomData>
<CustomData Category="Permissions" Type="XmlPermissions">
<Metadata Name="FileName" Value="C:\PROJECTS\MYFRIENDSAROUND\MYFRIENDSAROUND.DB\PROPERTIES\DATABASE.SQLPERMISSIONS" />
</CustomData>
</Header>
<Model>
<Element Type="ISql100DatabaseOptions">
<Property Name="Collation" Value="SQL_Latin1_General_CP1_CI_AS" />
<Property Name="IsAnsiNullDefaultOn" Value="True" />
<Property Name="IsAnsiNullsOn" Value="True" />
<Property Name="IsAnsiWarningsOn" Value="True" />
<Property Name="IsArithAbortOn" Value="True" />
<Property Name="IsConcatNullYieldsNullOn" Value="True" />
<Property Name="IsTornPageProtectionOn" Value="False" />
<Property Name="IsFullTextEnabled" Value="True" />
<Property Name="PageVerifyMode" Value="3" />
<Relationship Name="DefaultFilegroup">
<Entry>
<References ExternalSource="BuiltIns" Name="[PRIMARY]" />
</Entry>
</Relationship>
</Element>
</Model>
</DataSchemaModel>
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetDatabase>MyFriendsAround.DB</TargetDatabase>
<DeployToDatabase>False</DeployToDatabase>
<DeployToScript>True</DeployToScript>
<SourceModel>MyFriendsAround.DB.dbschema</SourceModel>
<DeployScriptFileName>MyFriendsAround.DB.sql</DeployScriptFileName>
<DeploymentConfigurationFile>MyFriendsAround.DB_Database.sqldeployment</DeploymentConfigurationFile>
</PropertyGroup>
<PropertyGroup>
<SqlCommandVariablesFile>MyFriendsAround.DB_Database.sqlcmdvars</SqlCommandVariablesFile>
</PropertyGroup>
<ItemGroup>
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PostDeployment.sql">
<__PostdeploymentMetadata>
</__PostdeploymentMetadata>
</DeploymentExtensionConfiguration>
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PreDeployment.sql">
<__PredeploymentMetadata>
</__PredeploymentMetadata>
</DeploymentExtensionConfiguration>
</ItemGroup>
<ItemGroup>
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPlanOrderModifier">
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
<Version>10.0.0.0</Version>
<Token>sD9ffxHVCjo=</Token>
</DeploymentExtension>
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPrePostDeploymentModifier">
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
<Version>10.0.0.0</Version>
<Token>sD9ffxHVCjo=</Token>
</DeploymentExtension>
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Refactoring.SqlRefactoringDeploymentContributor">
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
<Version>10.0.0.0</Version>
<Token>sD9ffxHVCjo=</Token>
</DeploymentExtension>
</ItemGroup>
</Project>
@@ -1,211 +0,0 @@
/*
Deployment script for MyFriendsAround.DB
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
GO
:setvar DatabaseName "MyFriendsAround.DB"
:setvar DefaultDataPath ""
:setvar DefaultLogPath ""
GO
:on error exit
GO
USE [master]
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 (DB_ID(N'$(DatabaseName)') IS NOT NULL)
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE [$(DatabaseName)];
END
GO
PRINT N'Creating $(DatabaseName)...'
GO
CREATE DATABASE [$(DatabaseName)] COLLATE SQL_Latin1_General_CP1_CI_AS
GO
EXECUTE sp_dbcmptlevel [$(DatabaseName)], 100;
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET ANSI_NULLS ON,
ANSI_PADDING ON,
ANSI_WARNINGS ON,
ARITHABORT ON,
CONCAT_NULL_YIELDS_NULL ON,
NUMERIC_ROUNDABORT OFF,
QUOTED_IDENTIFIER ON,
ANSI_NULL_DEFAULT ON,
CURSOR_DEFAULT LOCAL,
RECOVERY FULL,
CURSOR_CLOSE_ON_COMMIT OFF,
AUTO_CREATE_STATISTICS ON,
AUTO_SHRINK OFF,
AUTO_UPDATE_STATISTICS ON,
RECURSIVE_TRIGGERS OFF
WITH ROLLBACK IMMEDIATE;
ALTER DATABASE [$(DatabaseName)]
SET AUTO_CLOSE OFF
WITH ROLLBACK IMMEDIATE;
END
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET ALLOW_SNAPSHOT_ISOLATION OFF;
END
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET READ_COMMITTED_SNAPSHOT OFF;
END
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET AUTO_UPDATE_STATISTICS_ASYNC OFF,
PAGE_VERIFY NONE,
DATE_CORRELATION_OPTIMIZATION OFF,
DISABLE_BROKER,
PARAMETERIZATION SIMPLE,
SUPPLEMENTAL_LOGGING OFF
WITH ROLLBACK IMMEDIATE;
END
GO
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
BEGIN
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
SET TRUSTWORTHY OFF,
DB_CHAINING OFF
WITH ROLLBACK IMMEDIATE';
END
END
ELSE
BEGIN
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
END
GO
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
BEGIN
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
SET HONOR_BROKER_PRIORITY OFF
WITH ROLLBACK IMMEDIATE';
END
END
ELSE
BEGIN
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
END
GO
USE [$(DatabaseName)]
GO
IF fulltextserviceproperty(N'IsFulltextInstalled') = 1
EXECUTE sp_fulltext_database 'enable';
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
-- Refactoring step to update target server with deployed transaction logs
CREATE TABLE [dbo].[__RefactorLog] (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY)
GO
sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog'
GO
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
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
DECLARE @VarDecimalSupported AS BIT;
SELECT @VarDecimalSupported = 0;
IF ((ServerProperty(N'EngineEdition') = 3)
AND (((@@microsoftversion / power(2, 24) = 9)
AND (@@microsoftversion & 0xffff >= 3024))
OR ((@@microsoftversion / power(2, 24) = 10)
AND (@@microsoftversion & 0xffff >= 1600))))
SELECT @VarDecimalSupported = 1;
IF (@VarDecimalSupported > 0)
BEGIN
EXECUTE sp_db_vardecimal_storage_format N'$(DatabaseName)', 'ON';
END
END
GO
ALTER DATABASE [$(DatabaseName)]
SET MULTI_USER
WITH ROLLBACK IMMEDIATE;
GO
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<SqlCommandVariables xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.SqlCmdVars" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0</Version>
<Properties>
</Properties>
</SqlCommandVariables>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DeploymentConfigurationSettings xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.DeploymentConfigurationSettings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0</Version>
<Properties>
<AlwaysCreateNewDatabase>False</AlwaysCreateNewDatabase>
<BlockIncrementalDeploymentIfDataLoss>True</BlockIncrementalDeploymentIfDataLoss>
<DeployDatabaseProperties>True</DeployDatabaseProperties>
<DeploymentCollationPreference>UseSourceModelCollation</DeploymentCollationPreference>
<DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>False</DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>
<GenerateDropsIfNotInProject>False</GenerateDropsIfNotInProject>
<PerformDatabaseBackup>False</PerformDatabaseBackup>
<SingleUserMode>False</SingleUserMode>
</Properties>
</DeploymentConfigurationSettings>
@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<CatalogProperties xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.CatalogProperties" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0</Version>
<Properties>
<!--Sql Server 2000-->
<DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation>
<AnsiNullDefault>True</AnsiNullDefault>
<AnsiNulls>True</AnsiNulls>
<AnsiPadding>True</AnsiPadding>
<AnsiWarnings>True</AnsiWarnings>
<ArithAbort>True</ArithAbort>
<ConcatNullYieldsNull>True</ConcatNullYieldsNull>
<QuotedIdentifier>True</QuotedIdentifier>
<NumericRoundAbort>False</NumericRoundAbort>
<RecursiveTriggersEnabled>False</RecursiveTriggersEnabled>
<DatabaseState>ONLINE</DatabaseState>
<UpdateOptions>READ_WRITE</UpdateOptions>
<CloseCursorOnCommitEnabled>False</CloseCursorOnCommitEnabled>
<DefaultCursor>LOCAL</DefaultCursor>
<AutoClose>False</AutoClose>
<AutoCreateStatistics>True</AutoCreateStatistics>
<AutoShrink>False</AutoShrink>
<AutoUpdateStatistics>True</AutoUpdateStatistics>
<TornPageDetection>False</TornPageDetection>
<DatabaseAccess>MULTI_USER</DatabaseAccess>
<Recovery>FULL</Recovery>
<EnableFullTextSearch>True</EnableFullTextSearch>
<DatabaseChaining>False</DatabaseChaining>
<DefaultFilegroup>PRIMARY</DefaultFilegroup>
<!--Sql Server 2005-->
<!--<CompatibilityMode></CompatibilityMode>-->
<Trustworthy>False</Trustworthy>
<AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously>
<PageVerify>NONE</PageVerify>
<ServiceBrokerOption>DisableBroker</ServiceBrokerOption>
<DateCorrelationOptimizationOn>False</DateCorrelationOptimizationOn>
<Parameterization>SIMPLE</Parameterization>
<AllowSnapshotIsolation>False</AllowSnapshotIsolation>
<ReadCommittedSnapshot>False</ReadCommittedSnapshot>
<VardecimalStorageFormatOn>True</VardecimalStorageFormatOn>
<SupplementalLoggingOn>False</SupplementalLoggingOn>
<!--Sql Server 2008-->
<DefaultFileStreamFilegroup></DefaultFileStreamFilegroup>
<IsChangeTrackingOn>False</IsChangeTrackingOn>
<IsChangeTrackingAutoCleanupOn>True</IsChangeTrackingAutoCleanupOn>
<ChangeTrackingRetentionPeriod>2</ChangeTrackingRetentionPeriod>
<ChangeTrackingRetentionUnit>Days</ChangeTrackingRetentionUnit>
<IsEncryptionOn>False</IsEncryptionOn>
<IsBrokerPriorityHonored>False</IsBrokerPriorityHonored>
</Properties>
</CatalogProperties>
@@ -1,11 +0,0 @@
/*
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)]
--------------------------------------------------------------------------------------
*/
@@ -1,11 +0,0 @@
/*
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)]
--------------------------------------------------------------------------------------
*/
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DataSchemaModel FileFormatVersion="1.2" SchemaVersion="1.1" DspName="Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider" CollationLcid="1033" CollationCaseSensitive="False">
<Header>
<CustomData Category="ModelCapability">
<Metadata Name="ModelCapability" Value="Default" />
</CustomData>
<CustomData Category="ClrTypesDbSchema" Type="DbSchema">
<Metadata Name="ClrTypesDbSchema" Value="True" />
</CustomData>
<CustomData Category="AnsiNulls">
<Metadata Name="AnsiNulls" Value="True" />
</CustomData>
<CustomData Category="QuotedIdentifier">
<Metadata Name="QuotedIdentifier" Value="True" />
</CustomData>
<CustomData Category="CompatibilityMode">
<Metadata Name="CompatibilityMode" Value="100" />
</CustomData>
<CustomData Category="Permissions" Type="XmlPermissions">
<Metadata Name="FileName" Value="C:\PROJECTS\MYFRIENDSAROUND\MYFRIENDSAROUND.DB\PROPERTIES\DATABASE.SQLPERMISSIONS" />
</CustomData>
</Header>
<Model>
<Element Type="ISql100DatabaseOptions">
<Property Name="Collation" Value="SQL_Latin1_General_CP1_CI_AS" />
<Property Name="IsAnsiNullDefaultOn" Value="True" />
<Property Name="IsAnsiNullsOn" Value="True" />
<Property Name="IsAnsiWarningsOn" Value="True" />
<Property Name="IsArithAbortOn" Value="True" />
<Property Name="IsConcatNullYieldsNullOn" Value="True" />
<Property Name="IsTornPageProtectionOn" Value="False" />
<Property Name="IsFullTextEnabled" Value="True" />
<Property Name="PageVerifyMode" Value="3" />
<Relationship Name="DefaultFilegroup">
<Entry>
<References ExternalSource="BuiltIns" Name="[PRIMARY]" />
</Entry>
</Relationship>
</Element>
</Model>
</DataSchemaModel>
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetDatabase>MyFriendsAround.DB</TargetDatabase>
<DeployToDatabase>False</DeployToDatabase>
<DeployToScript>True</DeployToScript>
<SourceModel>MyFriendsAround.DB.dbschema</SourceModel>
<DeployScriptFileName>MyFriendsAround.DB.sql</DeployScriptFileName>
<DeploymentConfigurationFile>MyFriendsAround.DB_Database.sqldeployment</DeploymentConfigurationFile>
</PropertyGroup>
<PropertyGroup>
<SqlCommandVariablesFile>MyFriendsAround.DB_Database.sqlcmdvars</SqlCommandVariablesFile>
</PropertyGroup>
<ItemGroup>
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PostDeployment.sql">
<__PostdeploymentMetadata>
</__PostdeploymentMetadata>
</DeploymentExtensionConfiguration>
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PreDeployment.sql">
<__PredeploymentMetadata>
</__PredeploymentMetadata>
</DeploymentExtensionConfiguration>
</ItemGroup>
<ItemGroup>
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPlanOrderModifier">
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
<Version>10.0.0.0</Version>
<Token>sD9ffxHVCjo=</Token>
</DeploymentExtension>
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPrePostDeploymentModifier">
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
<Version>10.0.0.0</Version>
<Token>sD9ffxHVCjo=</Token>
</DeploymentExtension>
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Refactoring.SqlRefactoringDeploymentContributor">
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
<Version>10.0.0.0</Version>
<Token>sD9ffxHVCjo=</Token>
</DeploymentExtension>
</ItemGroup>
</Project>
@@ -1,211 +0,0 @@
/*
Deployment script for MyFriendsAround.DB
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
GO
:setvar DatabaseName "MyFriendsAround.DB"
:setvar DefaultDataPath ""
:setvar DefaultLogPath ""
GO
:on error exit
GO
USE [master]
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 (DB_ID(N'$(DatabaseName)') IS NOT NULL)
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE [$(DatabaseName)];
END
GO
PRINT N'Creating $(DatabaseName)...'
GO
CREATE DATABASE [$(DatabaseName)] COLLATE SQL_Latin1_General_CP1_CI_AS
GO
EXECUTE sp_dbcmptlevel [$(DatabaseName)], 100;
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET ANSI_NULLS ON,
ANSI_PADDING ON,
ANSI_WARNINGS ON,
ARITHABORT ON,
CONCAT_NULL_YIELDS_NULL ON,
NUMERIC_ROUNDABORT OFF,
QUOTED_IDENTIFIER ON,
ANSI_NULL_DEFAULT ON,
CURSOR_DEFAULT LOCAL,
RECOVERY FULL,
CURSOR_CLOSE_ON_COMMIT OFF,
AUTO_CREATE_STATISTICS ON,
AUTO_SHRINK OFF,
AUTO_UPDATE_STATISTICS ON,
RECURSIVE_TRIGGERS OFF
WITH ROLLBACK IMMEDIATE;
ALTER DATABASE [$(DatabaseName)]
SET AUTO_CLOSE OFF
WITH ROLLBACK IMMEDIATE;
END
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET ALLOW_SNAPSHOT_ISOLATION OFF;
END
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET READ_COMMITTED_SNAPSHOT OFF;
END
GO
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
ALTER DATABASE [$(DatabaseName)]
SET AUTO_UPDATE_STATISTICS_ASYNC OFF,
PAGE_VERIFY NONE,
DATE_CORRELATION_OPTIMIZATION OFF,
DISABLE_BROKER,
PARAMETERIZATION SIMPLE,
SUPPLEMENTAL_LOGGING OFF
WITH ROLLBACK IMMEDIATE;
END
GO
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
BEGIN
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
SET TRUSTWORTHY OFF,
DB_CHAINING OFF
WITH ROLLBACK IMMEDIATE';
END
END
ELSE
BEGIN
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
END
GO
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
BEGIN
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
SET HONOR_BROKER_PRIORITY OFF
WITH ROLLBACK IMMEDIATE';
END
END
ELSE
BEGIN
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
END
GO
USE [$(DatabaseName)]
GO
IF fulltextserviceproperty(N'IsFulltextInstalled') = 1
EXECUTE sp_fulltext_database 'enable';
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
-- Refactoring step to update target server with deployed transaction logs
CREATE TABLE [dbo].[__RefactorLog] (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY)
GO
sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog'
GO
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
IF EXISTS (SELECT 1
FROM [master].[dbo].[sysdatabases]
WHERE [name] = N'$(DatabaseName)')
BEGIN
DECLARE @VarDecimalSupported AS BIT;
SELECT @VarDecimalSupported = 0;
IF ((ServerProperty(N'EngineEdition') = 3)
AND (((@@microsoftversion / power(2, 24) = 9)
AND (@@microsoftversion & 0xffff >= 3024))
OR ((@@microsoftversion / power(2, 24) = 10)
AND (@@microsoftversion & 0xffff >= 1600))))
SELECT @VarDecimalSupported = 1;
IF (@VarDecimalSupported > 0)
BEGIN
EXECUTE sp_db_vardecimal_storage_format N'$(DatabaseName)', 'ON';
END
END
GO
ALTER DATABASE [$(DatabaseName)]
SET MULTI_USER
WITH ROLLBACK IMMEDIATE;
GO
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<SqlCommandVariables xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.SqlCmdVars" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0</Version>
<Properties>
</Properties>
</SqlCommandVariables>
@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<DeploymentConfigurationSettings xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.DeploymentConfigurationSettings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0</Version>
<Properties>
<AlwaysCreateNewDatabase>False</AlwaysCreateNewDatabase>
<BlockIncrementalDeploymentIfDataLoss>True</BlockIncrementalDeploymentIfDataLoss>
<DeployDatabaseProperties>True</DeployDatabaseProperties>
<DeploymentCollationPreference>UseSourceModelCollation</DeploymentCollationPreference>
<DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>False</DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>
<GenerateDropsIfNotInProject>False</GenerateDropsIfNotInProject>
<PerformDatabaseBackup>False</PerformDatabaseBackup>
<SingleUserMode>False</SingleUserMode>
</Properties>
</DeploymentConfigurationSettings>
@@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<CatalogProperties xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.CatalogProperties" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Version>1.0</Version>
<Properties>
<!--Sql Server 2000-->
<DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation>
<AnsiNullDefault>True</AnsiNullDefault>
<AnsiNulls>True</AnsiNulls>
<AnsiPadding>True</AnsiPadding>
<AnsiWarnings>True</AnsiWarnings>
<ArithAbort>True</ArithAbort>
<ConcatNullYieldsNull>True</ConcatNullYieldsNull>
<QuotedIdentifier>True</QuotedIdentifier>
<NumericRoundAbort>False</NumericRoundAbort>
<RecursiveTriggersEnabled>False</RecursiveTriggersEnabled>
<DatabaseState>ONLINE</DatabaseState>
<UpdateOptions>READ_WRITE</UpdateOptions>
<CloseCursorOnCommitEnabled>False</CloseCursorOnCommitEnabled>
<DefaultCursor>LOCAL</DefaultCursor>
<AutoClose>False</AutoClose>
<AutoCreateStatistics>True</AutoCreateStatistics>
<AutoShrink>False</AutoShrink>
<AutoUpdateStatistics>True</AutoUpdateStatistics>
<TornPageDetection>False</TornPageDetection>
<DatabaseAccess>MULTI_USER</DatabaseAccess>
<Recovery>FULL</Recovery>
<EnableFullTextSearch>True</EnableFullTextSearch>
<DatabaseChaining>False</DatabaseChaining>
<DefaultFilegroup>PRIMARY</DefaultFilegroup>
<!--Sql Server 2005-->
<!--<CompatibilityMode></CompatibilityMode>-->
<Trustworthy>False</Trustworthy>
<AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously>
<PageVerify>NONE</PageVerify>
<ServiceBrokerOption>DisableBroker</ServiceBrokerOption>
<DateCorrelationOptimizationOn>False</DateCorrelationOptimizationOn>
<Parameterization>SIMPLE</Parameterization>
<AllowSnapshotIsolation>False</AllowSnapshotIsolation>
<ReadCommittedSnapshot>False</ReadCommittedSnapshot>
<VardecimalStorageFormatOn>True</VardecimalStorageFormatOn>
<SupplementalLoggingOn>False</SupplementalLoggingOn>
<!--Sql Server 2008-->
<DefaultFileStreamFilegroup></DefaultFileStreamFilegroup>
<IsChangeTrackingOn>False</IsChangeTrackingOn>
<IsChangeTrackingAutoCleanupOn>True</IsChangeTrackingAutoCleanupOn>
<ChangeTrackingRetentionPeriod>2</ChangeTrackingRetentionPeriod>
<ChangeTrackingRetentionUnit>Days</ChangeTrackingRetentionUnit>
<IsEncryptionOn>False</IsEncryptionOn>
<IsBrokerPriorityHonored>False</IsBrokerPriorityHonored>
</Properties>
</CatalogProperties>
@@ -1,11 +0,0 @@
/*
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)]
--------------------------------------------------------------------------------------
*/
@@ -1,11 +0,0 @@
/*
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)]
--------------------------------------------------------------------------------------
*/