|
Trusted Database Command File Installation Documentation |
CSKDBtrusted.CMD can automate installing the CSKDotNet 1.1 database objects over trusted connections. You can use this file instead of the CSKDB.CMD file that shipped with the CSKDot 1.1 project.
The first thing to do is to copy the included CSKDBtrusted.CMD and CreateASPNETDatabaseUser.sql into your CSKDotNet 1.1's /SQL folder (along side the old CSKDB.CMD file).
CSKDBtrusted.CMD can operate in 3 modes:
- Create a new CSK 1.1 database (and user)
- Populate CSK 1.1 objects into an existing database"
- Upgrade a CSK 1.0 database with CSK 1.1 objects and required Schema changes.
The CSKDBtrusted.CMD file can be executed from a command window (DOS prompt). You can copy the entire /SQL folder to your local machine to make running the command file easier.
CSKDB.CMD Syntax:
CSKDBtrusted.CMD [Server], [Database], [Action]
CSKDBtrusted.CMD parameters:
- [Server] = Required: The name of the server to execute the scripts against. For your local machine, you can use "localhost".
- [Database] = Required: The name of the database on the target server to create, upgrade, or populate.
- [Action] = Optional: If not supplied, a new database will be created. Valid values are:
- "new" - Create a new database and populate with CSKDotNet 1.1 objects.
- "populate" - Create CSKDotNet objects and tables in an existing database. Will overwrite existing CSK tables in the target database.
- "upgrade" - Upgrade CSK 1.0 objects in an existing database. Will not overwrite tables or existing CSK 1.0 data, but does replace all stored procedures and functions. Also makes modifications to CSK 1.0 tables needed for CSK 1.1 functionality.
Usage Example:
CSKDBtrusted.CMD localhost, MyDatabase, new
Creating the ASPNET user account for trusted access:
To create a trusted logon that the ASP.NET worker process can use to access the SQL server, you must edit and execute the included CreateASPNETDatabaseUser.sql file against your database (or use Enterprise manager to create such an account). Then you must edit the connection string in web.config to use the trusted connection.
First, edit the CreateASPNETDatabaseUser.sql file. replace all occurances of "@MachineName@" with the name of your server machine. If your web server uses a domain account instead of a local account for the ASP.NET worker process, replace "@MachineName@/ASPNET" with the domain and user name used by your web (as defined in machine.config).
Also, you must replace "@DatabaseName@" with the name of the CSKDotNet 1.1 database you created when you ran CSKDBtrusted.CMD.
Next, use SQL Query Analyzer or another similar tool to execute the script against your database to create the login and grant it the correct permissions. You can also use OSQL at the command line to run this script. At the command prompt simply type this:
osql -S %1 -d %2 -E -b -i "CreateASPNETDatabaseUser.sql"Note: replace %1 with the server name and %2 with the database name before you use this OSQL command.
Finally, you need to update your connection string in web.config with one that uses a trusted connection. Here is an example of such a connection string:
server=localhost;Trusted_Connection=true;database=CommunityStarterKit