SqlServer服务器和数据库角色
首先我们来阐述服务器(实例级别)的权限,实例级别和数据库级别权限的最大不同在于:实例级别的权限是直接授权给登录名,而数据库级别的全显示授予数据库用户的,然后数据库用户再与登录名匹配。(再SqlServer中,登录名和用户是两个概念,登录名用于登录到
首先我们来阐述服务器(实例级别)的权限,实例级别和数据库级别权限的最大不同在于:实例级别的权限是直接授权给登录名,而数据库级别的全显示授予数据库用户的,然后数据库用户再与登录名匹配。(再SqlServer中,登录名和用户是两个概念,登录名用于登录到数据库实例,而用户位于数据库之内,用于和登录名匹配)
举例:
--指定登录名为dbtester,并且创建test数据库中的用户tester1 execute sp_grantdbaccess ‘dbtester’,'tester1'
在服务器(实例)范围内,对于不同的对象也可以授予不同的权限,主要有以下几种:端点,登录名,高可用性组,自定义服务器角色,固定服务器角色。利用sys.server_principals和sys.server_permissions 这两个视图可以查看已经被授予的权限。
示例:
其中我们要注意,Control Server 授予用户超级管理员的权限,可以让用户拥有对SqlServer的最高控制权,所以一般不要授予这个权限。
重点介绍一下固定服务器的角色,一共是九个分别是:
sysadmin
执行SQL Server中的任何动作,也是对任何数据库的任何操作的权限。
serveradmin
配置服务器设置,并可使用SHUTDOWN来停止实例的权限。
setupadmin
向该服务器角色中添加其他登录,添加、删除或配置链接的服务器,执行一些系统过程,如sp_serveroption。
securityadmin
用于管理登录名、读取错误日志和创建数据库许可权限的登录名,可以执行关于服务器访问和安全的所有动作。
processadmin
管理SQL Server进程,在实例中杀死其他用户进程的权限。
dbcreator
创建和修改数据库
diskadmin
管理物理数据库的权限。
bulkadmin
向数据库批量插入数据的权限(SqlServer2005中被添加进来)
public
本身不授予其他成员任何权限。只有连接权限。
固定数据库角色在数据库层上进行定义,因此它们存在于属于数据库服务器的每个数据库中。列出了所有的固定数据库角色。
db_owner
可以执行数据库中技术所有动作的用户
db_accessadmin
可以添加、删除用户的用户
db_datareader
可以查看所有数据库中用户表内数据的用户
db_datawriter
可以添加、修改或删除所有数据库中用户表内数据的用户
db_ddladmin
可以在数据库中执行所有DDL操作的用户
db_securityadmin
可以管理数据库中与安全权限有关所有动作的用户
db_backoperator
可以备份数据库的用户(并可以发布DBCC和CHECKPOINT语句,这两个语句一般在备份前都会被执行)
db_denydatareader
不能看到数据库中任何数据的用户
db_denydatawriter
不能改变数据库中任何数据的用户
参考:http://www.cnblogs.com/dannyli/archive/2012/09/18/2690740.html

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

According to news from this website on July 23, ASUS has launched a variety of server and workstation-level products powered by AMD EPYC 4004 series processors. Note from this site: AMD launched the AM5 platform and Zen4 architecture EPYC 4004 series processors in May, offering up to 16-core 3DV-Cache specifications. ASUSProER100AB6 server ASUSProER100AB6 is a 1U rack server product equipped with EPYC Xiaolong 4004 series processor, suitable for the needs of IDC and small and medium-sized enterprises. ASUSExpertCenterProET500AB6 workstation ASUSExpertCenterProET500AB6 is a

After the second beta test of "Zhu Xian World" ended, players' evaluations were polarized. After the second test, the official also listed a tuning list to make adjustments in five aspects: economy, development, gameplay, functions, and art. It means that corresponding optimization measures will be made in response to problems reported by players. Today, "Zhu Xian World" released a demonstration of the progress of character medical beauty in the explosive reform plan. Through screen comparison, we will show you the phased results of the project team's radical character changes in the past few months. Which version do you think looks better? The following is the exposure plan previously announced by "Zhu Xian World":

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

JSON data can be saved into a MySQL database by using the gjson library or the json.Unmarshal function. The gjson library provides convenience methods to parse JSON fields, and the json.Unmarshal function requires a target type pointer to unmarshal JSON data. Both methods require preparing SQL statements and performing insert operations to persist the data into the database.

Through the Go standard library database/sql package, you can connect to remote databases such as MySQL, PostgreSQL or SQLite: create a connection string containing database connection information. Use the sql.Open() function to open a database connection. Perform database operations such as SQL queries and insert operations. Use defer to close the database connection to release resources.
