Article - CS317235
Unable to use the database creation script thingworxMssqlDBSetup.bat to create a database if the -d option is not "thingworx"
Modified: 18-Mar-2021
Applies To
- ThingWorx Platform 8.5
- Microsoft SQL Server
Description
- Database creation script thingworxMssqlDBSetup.bat fails when the database name is different than the default of thingworx
- Script output when name other than thingworx is designated for -d:
C:\Installs\MED-61212-CD-085_F000_ThingWorx-Platform-Mssql-8-5-0\install>thingworxMssqlDBSetup.bat -h localhost -i SQLEXPRESS -p 1433 -a sa -l twadmin -d twdev2 -u twadmin -s twschema
Server=localhost
Server Instance=SQLEXPRESS
Port=1433
Admin User=sa
Login Name=twadmin
Database=twdev2
Thingworx User=twadmin
Schema=twschema
Start Execution
Password: Msg 5011, Level 14, State 5, Server <hostname>\SQLEXPRESS, Line 3
User does not have permission to alter database 'thingworx', the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 3
ALTER DATABASE statement failed.
Password: Msg 15007, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 3
'twadmin' is not a valid login or you do not have permission.
Msg 15151, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 2
Cannot add the principal 'twadmin', because it does not exist or you do not have permission.
Msg 15151, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 2
Cannot find the user 'twadmin', because it does not exist or you do not have permission.
Msg 2759, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 2
CREATE SCHEMA failed due to previous errors.
Press any key to continue . . .
End Execution
C:\Installs\MED-61212-CD-085_F000_ThingWorx-Platform-Mssql-8-5-0\install>
Server=localhost
Server Instance=SQLEXPRESS
Port=1433
Admin User=sa
Login Name=twadmin
Database=twdev2
Thingworx User=twadmin
Schema=twschema
Start Execution
Password: Msg 5011, Level 14, State 5, Server <hostname>\SQLEXPRESS, Line 3
User does not have permission to alter database 'thingworx', the database does not exist, or the database is not in a state that allows access checks.
Msg 5069, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 3
ALTER DATABASE statement failed.
Password: Msg 15007, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 3
'twadmin' is not a valid login or you do not have permission.
Msg 15151, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 2
Cannot add the principal 'twadmin', because it does not exist or you do not have permission.
Msg 15151, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 2
Cannot find the user 'twadmin', because it does not exist or you do not have permission.
Msg 2759, Level 16, State 1, Server <hostname>\SQLEXPRESS, Line 2
CREATE SCHEMA failed due to previous errors.
Press any key to continue . . .
End Execution
C:\Installs\MED-61212-CD-085_F000_ThingWorx-Platform-Mssql-8-5-0\install>
This is a printer-friendly version of Article 317235 and may be out of date. For the latest version click CS317235