Closed FrankBerrocal closed 1 year ago
Waiting for complete script to gain time.
Script uploaded to Repo.
SQL script is being added as document for the project, for backup purposes. I have tested ALTER elements in C#.
Instead of completing 100% of script, I will code what I have now and include all the technical requirements after creating the DB via C#
Merge completed.
First element, Alter Database
` Console.Write("Alter Database"); sb.Clear(); sb.Append("USE TestDB; ");
sb.Append("ALTER DATABASE CURRENT");
sb.Append(" SET RECOVERY FULL, ");
sb.Append(" ANSI_NULLS ON, ");
sb.Append(" ANSI_PADDING ON, ");
sb.Append(" ANSI_WARNINGS ON, ");
sb.Append(" ARITHABORT ON, ");
sb.Append(" CONCAT_NULL_YIELDS_NULL ON, ");
sb.Append(" QUOTED_IDENTIFIER ON, ");
sb.Append(" NUMERIC_ROUNDABORT OFF, ");
sb.Append(" PAGE_VERIFY CHECKSUM, ");
sb.Append(" ALLOW_SNAPSHOT_ISOLATION ON; ");
//sb.Append("GO "); This is T-SQL especific. Cannot be used in SQLClient. SqlException (0x80131904): Incorrect syntax near 'GO'.
sql = sb.ToString();
using (SqlCommand command = new SqlCommand(sql, connection))
{
int rowsAffected = command.ExecuteNonQuery();
Console.WriteLine(rowsAffected + " Database has been Altered");
}`
Following the structure of AdventureWorks database, I am creating the Schemas along with the database. Further research to add specific options is needed.
Creation of Database admin userCreate schema CalculationSelecting Database-1 Schema created Create table CostVariance under schema Calculation Selecting Database-1 Table created Create table Schedule Variance under schema Calculation Selecting Database-1 Table created Create table Variance At Completion under schema Calculation Selecting Database-1 Table created Create table Cost Performance Index under schema Calculation Selecting Database-1 Table created Create table Schedule Performance Index under schema Calculation Selecting Database-1 Table created Create table Estimate At Completion under schema Calculation Selecting Database-1 Table created Create table To Complete Performance Index under schema Calculation Selecting Database-1 Table created Create table Total Cost under schema Calculation Selecting Database-1 Table created
The process of C# to SQL Translation is slow, and valuation of changes should be made on both c# code and SQL script (since they both will be documentation material to two different stakeholders).
What should be the schema of higher level tables?
https://www.simplilearn.com/tutorials/sql-tutorial/schema-in-sql
https://www.integrate.io/blog/complete-guide-to-database-schema-design-guide/
Type of schema organizations (design perspective).
Hierarchical schema organization. Project will include higher level tables and those schemas will be assigned accordingly.
All Calculation schema tables have been completed. I am working now on Project Schema: Project, Dashboard, project type, and knowledge area.
Plan for today, I will be completing the Project, Cost, Schedule, and Scope Schema. This will be renamed as Database and Calculations Schema, in order to avoid documenting all the work in one single task. This should be mapped to user stories when completed.
Database has been created and all Calculations tables create, same as the schemas. One User created for testing by I need to research more on the subject (general knowledge, not C# to SQL since that is working ok). I cannot associate the user to my schema.
Estimated time: 16 hours. Learning how to send all elements correctly, also defining the database in SQL at the same time. This is a parallel task, whatever is decided to go on the database, is first defined, tested on the SQL script in SQL Server, then coded in C#, and then tested again to see the effects on the database. Container should be switched on and off since buffering affects memory, and multiple errors are received.
Coding of all structures in C#. Later, focused on Database and Calculations Schema.