Added and enhanced SQL Querys and connection blocker
This commit is contained in:
parent
b5736e9e3c
commit
66eb53fadc
|
@ -30,8 +30,8 @@
|
||||||
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
|
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
|
||||||
</system.serviceModel>
|
</system.serviceModel>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="EHEC_DBEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=LAPTOP-S6N189QG;initial catalog=EHEC_DB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
<!--<add name="EHEC_DBEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=LAPTOP-S6N189QG;initial catalog=EHEC_DB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />-->
|
||||||
<!--<add name="EHEC_DBEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;initial catalog=EHEC_DB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />-->
|
<add name="EHEC_DBEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;initial catalog=EHEC_DB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<entityFramework>
|
<entityFramework>
|
||||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||||
|
|
|
@ -11,16 +11,25 @@
|
||||||
-- 180629 Ivan, Add inserts for fixed lists
|
-- 180629 Ivan, Add inserts for fixed lists
|
||||||
-- --------------------------------------------------
|
-- --------------------------------------------------
|
||||||
|
|
||||||
|
-- Set DB toSingle User so open connections do not block
|
||||||
|
-- --------------------------------------------------
|
||||||
|
PRINT 'Set Multiuser to Singleuser so all open connections are cut...';
|
||||||
|
use master
|
||||||
|
ALTER DATABASE EHEC_DB SET SINGLE_USER WITH ROLLBACK IMMEDIATE
|
||||||
|
-- --------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- Auskommentieren für Löschung der Datenbank
|
-- Auskommentieren für Löschung der Datenbank
|
||||||
IF db_id('EHEC_DB') is not null
|
IF db_id('EHEC_DB') is not null
|
||||||
BEGIN;
|
BEGIN;
|
||||||
PRINT 'EHEC_DB existiert bereits, sie wird nun geloescht und neu Gebaut'
|
PRINT 'EHEC_DB already EXISTS, db will be deleted for a new creation.'
|
||||||
USE [master];
|
USE [master];
|
||||||
DROP DATABASE EHEC_DB;
|
DROP DATABASE EHEC_DB;
|
||||||
END;
|
END;
|
||||||
ELSE
|
ELSE
|
||||||
BEGIN;
|
BEGIN;
|
||||||
PRINT 'EHEC_DB existiert noch nicht, die Datenbank wird nun neu Gebaut';
|
PRINT 'EHEC_DB does NOT EXISTS, the db will be created now...';
|
||||||
END;
|
END;
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
@ -273,9 +282,11 @@ VALUES
|
||||||
('EHEC-D'),
|
('EHEC-D'),
|
||||||
('EHEC-E')
|
('EHEC-E')
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
-- --------------------------------------------------
|
-- --------------------------------------------------
|
||||||
PRINT 'Erfolgreich!';
|
PRINT 'Set Singleuser mode back to Multiuser mode.';
|
||||||
|
-- set DB back to Multiuser so multiconnections are alowed again.
|
||||||
|
ALTER DATABASE EHEC_DB SET MULTI_USER
|
||||||
|
-- --------------------------------------------------
|
||||||
|
PRINT 'Successfull created your DB!';
|
||||||
-- Script has ended
|
-- Script has ended
|
||||||
-- --------------------------------------------------
|
-- --------------------------------------------------
|
Loading…
Reference in New Issue