Showing posts with label permissions. Show all posts
Showing posts with label permissions. Show all posts

Sunday, March 25, 2012

Creating a user for replication

Anyone have the steps (permissions and etc...) to create a user for use only in replications instead use "sa" login ?we have created a dedicated login for the Replication with sa rights|||but the user need to have sa role ?!|||Yes it needs to have the sa Rights..sql

Saturday, February 25, 2012

Creating a database from script - permissions problems

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

Sunday, February 19, 2012

Creating "installation" script

Hi all,

I′m newbie with SQL Server.

I need to create a installation script SQL
(creating tables, indexes, permissions, databases).
This script calls other scripts.
In Oracle I use @.script_name.sql, but in SQL Server
I don′t know to do this.

Other question: Is there a way to call the Query Analyzer
in .BAT file, where the .BAT file calls installation scripts SQL.

Thank U very much,

[]′s
Yes sure you can do this, you have to call the equivalent to sqlplus.exe for SQL Server, its OSQL.EXE. The -o Option takes an input file with the statements that you want to execute. Other options are described in detail -S for the server -U for the User -P for the password and so on.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de

|||Thank u very much!!!!

[]′s