Manual Creation of new database
Create a new database
Using Microsoft SQL Server Management Studio (SSMS), create a new database. Typically “studytrax” is used as the database name
It is recommended that the database's "Initial Size" is set to least 1000 MB (greater
if a lot of data is expected in the database)
Create the tables
Load the "Ddl.sql" file, load it into SSMS, and click the "Execute" button
In production, the "Ddl.sql" file is in _content\sql\
In development, run ConsolidateSqlFiles.
This places the “Ddl.sql” file in C:\dev\studytrax\app\Database\Output
Load stored procedures
Load the "StoredProcedures.sql" file, load it into SSMS, and click the "Execute" button
In production, the "StoredProcedures.sql" file is in _content\sql\
In development, the “StoredProcedures” file in C:\dev\studytrax\app\Database\Output
Initialize the database
Open a new window in SSMS, enter "EXEC dbo.InitializeDatabase" and click the Execute button.
Assign the database role to the login (user) the StudyTRAX system will use to access the database.
Open a new window in SSMS, enter “EXEC sp_addrolemember @RoleName='studytrax_executor', @MemberName='StudyTraxUser'“ and click the Execute button.
Replace 'StudyTraxUser' with the user StudyTRAX will use to connect to the database. The value for StudyTraxUser will be one of the following:
If the Connection String contains a SQL Server username, use that value.
If the Connection String uses integrated security, then use the windows login associated with the "Identity" set in the IIS Application Pool under which the StudyTrax application
is running. For example: 'MyDomain\StudyTrax' or 'NT AUTHORITY\SYSTEM'