It's quite common for shared hosting that you don't have enough permissions to create databases via SQL.
The usual solution (which you already tried) would be to create the database in the admin screen provided to you by your hoster, and then execute the rest of the SQL script, of course omitting the CREATE DATABASE
part at the beginning.
The problem is that the script does additional stuff besides creating the database, and you don't have enough permissions for that additional stuff.
The error message says that you don't have sufficient permissions to execute the stored procedure sp_delete_job
in the msdb
database, which deletes SQL Server Agent jobs.
So apparently ASP.NET's SQL Server session state includes some SQL Server Agent jobs, probably for regular database maintenance or something like that (I'm familiar with SQL Server, but not really with ASP.NET Session State).
The script probably tries to delete the jobs first if they are already there (and then re-creates them), hence the usage of sp_delete_job
.
Possible solution:
If you are able to create SQL Server Agent jobs via your provider's admin screen, you need to do this:
- execute only the part of the SQL Script that creates tables and stuff in the actual session database
- don't execute the part of the script that creates the SQL Server Agent jobs
- instead, manually create the SQL Server Agent jobs via your provider's admin screen
(if you aren't able to figure out which part of the SQL scripts creates the database and which part creates the jobs, you need to post the script here or give me a link to it, if it's available online somewhere)
In case you aren't able to create SQL Server Agent jobs via your admin screen (or if you're using SQL Server Express, which doesn't have SQL Server Agent!), you're out of luck.
Maybe you can get away without the jobs, it depends on what they're doing:
If they only do maintenance on the database, maybe you can periodically execute the necessary SQL (that the jobs are supposed to execute) by yourself.