We deploy our app via ClickOnce. Rather than shipping the .mdf and .ldf, the app detects whether the database is there and creates it via script if it's not. The script was originally generated from SQL Exrpess Mangement Console, etc.
In the past, we've made the stipulation that the user must have administrator access to the machine. However, we now need to find a workable solution for users who are not administrators on their machine. Currently, we use the following connection string before attempting to run the db creation script:
conn.ConnectionString = "Server=.\\sqlexpress;Integrated Security = true;User Instance=false";
The script fails when trying to execute "CREATE DATABASE [myDatabaseName] ON PRIMARY "
with the error:
"CREATE DATABASE permission denied in database 'Master'"
How can we get around this permissions issue in the most automated way possible?
TIA!
Hi,
you will need to have a user with dbcreator permissions, otherwise you won′t be able to make an entry in the sysdatabases (Creating a database). Can you use any administrative SQL Server login to connect to the database and make this possible ? The connection string has to include the userid as well as the password then.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
No comments:
Post a Comment