Grant permissions to user for backup/restore in SQL Server - sql-server-2005

Can anyone tell me what permissions must i give to a user inside SQL Server 2005 so that this user can backup and restore a database without given him sysadmin server role ?

There is a db_backupoperator fixed database role in 2005 that should meet your requirements. See description here https://technet.microsoft.com/en-US/library/ms189612(v=sql.90).aspx
USE YourDatabase
GO
EXEC sp_addrolemember 'db_backupoperator', 'YourUser'
GO

Related

When was the user added with sysadmin privileges SQL Server

How can I particularly find when a user was given sysadmin privileges in SQL Server?
Is there any Query?
Please help. Thanks!

SQL Server 2012 server role

In my SQL Server 2012 I have created a server role. I would like the server role can alter just one database one the server because I have many database on the server. How can I grant access for alter data in one database on the server?
Thank you in advance,
Nico.
Presumably you have just added the login to the server. Unless you have given the login sysadmin (I presume you have not), you will need to individually set the security per database ie. map the user to the database, e.g.
USE [Database]
GO
CREATE USER [User] FOR LOGIN [User] WITH DEFAULT_SCHEMA=[dbo]
GO
You will need to add the user to Security/Users in the actual database folder. If you want them to read/write data into/from existing tables, give them db_datareader and db_datawriter by right clicking and going to Properties -> Membership. If you want them to be able to create/drop objects in the database e.g. tables, they also need db_owner. They only have the rights for that db.
In addition of what TJB said, please document on : https://msdn.microsoft.com/ro-ro/library/ms178569.aspx

Creating group rights in Azure for SQL Server

I'm probably not phrasing that correctly. I have been asked to find a way to create a group in Azure; grant that group dbreader and dbwriter rights to SQL server, then create users in that group and assign non-Azure applications to those users. I am sure I'm not phrasing some of this correctly. The idea is that applications in the field should have access to the Azure-based Sql Server but only reading and writing to the DB.
RON
from your question it is not very clear if you are asking about SQL Server on the plain VM or SQL Server as a service (SQL Azure). If SQL Server on the VM, then it should be the same as locally.
If SQL Azure, you can try to add your user to the db_dbdatareader/writer role using Visual Studio or SSMS.
Or use the SQL syntax, something like this one:
CREATE ROLE MyDatabaseReaderRole AUTHORIZATION [dbo]
GRANT
ALTER,
CONTROL,
DELETE,
EXECUTE,
INSERT,
REFERENCES,
SELECT,
TAKE OWNERSHIP,
UPDATE,
VIEW DEFINITION
ON SCHEMA::dbo
TO MyDatabaseReaderRole
GO
-- Add an existing user to the new role created
EXEC sp_addrolemember 'MyDatabaseReaderRole', 'SomeUser'
GO

How do you change the owner of an Azure database

I'm trying to make a copy of a database in Azure. This requires that the user logged in be the db_owner of the database.
Unfortunately the person who created the database has left and we don't have their login credentials and they don't remember them either.
Is there any way to change the db_owner in Azure databases?
Note: Doing EXEC sp_addrolemember 'db_owner', 'login1User' doesn't work for this as the actual owner account is needed to copy a database in Azure.
ALTER AUTHORIZATION ON DATABASE::<YourDatabaseName> to [NewOwner];
You probably want to reset the password on the server (not the database). When you click on "SQL Databases" tab on the portal, you'll go to a list of your databases. On there there will be a
"Server" column. The entries in that column are hyperlinks. Click on the server you don't know the password for. on the Dashboard page for the server for the SQL Database you'll see a "Reset Administrator Password" link on the right under "quick glance".
Once you do that you can log into the management console for the database and change the logins for the database with ALTER LOGIN
To my knowledge there is no way to do this. Try looking in the former employees code for connections strings and hardcoded passwords.
You can also review this guide to see if there are any commands that may help you: Managing Databases and Logins in Windows Azure SQL Database

Read only SQL Server 2005 permission but allow stored procedure view

I have a SQL Server 2005 database and I need to be able to grant a user(someday a group) read only database permissions with the ability to view but not run or modify stored procedures across over a dozen databases. Is there a way to do this with the current database roles included with SQL Server 2005 or does the user have to be granted permissions on each individual stored procedure. Thank you.
GRANT VIEW ANY DEFINITION TO [Domain\UserName] worked for me.