Home Database Mysql Tutorial SQL Server 应用开发(三)

SQL Server 应用开发(三)

Jun 07, 2016 pm 03:09 PM
server sql Host application development Establish local register Remotely

(二) 建立注册:在对远程或本地主机进行管理时,需要先进行注册 方法: 1、在选定的 SQL SERVER 组上右击,选择新建 SQL SERVER 注册,弹出相应对话框 2、在向导的可用服务器列表中选择想要进行管理的远程服务器,本地服务器可以用 . 表示,然后添加到右侧

 

(二)建立注册:在对远程或本地主机进行管理时,需要先进行注册
      方法:

      1、在选定的“
SQL SERVER 组”上右击,选择“新建SQL SERVER 注册”,弹出相应对话框
      2、在向导的可用服务器列表中选择想要进行管理的远程服务器,本地服务器可以用“
.”表示,然后添加到右侧列表中,单击“下一步”
      3、选择相应的身份验证方式,分为两种:

         A.以windows身份进行验证:即以windows系统的登录方式进行验证,在成功登录系统后,即可登录SQL SERVER

         B.以SQL SERVERWINDOWS的混合方式进行验证:即在登录操作系统后,在登录SQL SERVER时还需要相应的验证(选择这项后,“下一步”会提示输入相应的验证帐号或密码),选择完成后“下一步”

      4、在这里要选择该注册属于哪个SQL SERVER组,或创建一个新的顶层组

      5、单击“完成”,如果正确连接和验证,将成功注册。


(三)建立登录并赋予权限:

      1、建立SQL SERVER登录帐户:即进入SQLSERVER系统时需要的帐户
         方法:在企业管理器中“安全性”节点下,右击“登录”,选择“新建登录”,会出现相应对话框,具体如下:

         A.常规标签:这里可以填写帐户的名称以及相应的验证方式,验证方式同“建立注册”,还可以指定此帐户的默认登录数据库
         B.服务器角色:这里可以对该帐户在服务器中所处的角色进行设置,角色详细定义此处不做具体解释

         C.数据库访问:在这里可以定义该用户可以访问的数据库以及在被许可访问的数据库中的帐户别名,只有被做许可的数据库,才可以进行访问,帐户别名是该帐户在指定数据库中使用的名称。


      2、建立数据库用户:即定义登录帐户可以进行访问的数据库

         方法:在允许访问的数据库下,选择并右击“用户”,选择“新建数据库用户”,弹出相应对话框,选择好帐户,还可以给帐户命名在该数据库中的别名。


      3、为帐户对数据库中相关表格授与权限:

         方法:在数据库的用户列表中,选择并右击该登录,并在快捷菜单中选择“所有任务”“管理权限”,可以对相应表格授与相应的权限,只有在授权后才能进行相应操作。


六、系统数据库和示例数据库:(理解)

(一)SQL SERVER中数据库按用途分类:
      1、系统数据库:管理和维护
SQL SERVER所必需的数据库

      2、示例数据库(用户数据库):用户自己创建的数据库,示例数据库也是用户数据库,提供一些作为例子的数据库。


(二)系统数据库:

      1、Master数据库:记录所有系统级别的信息

      2、Tempdb数据库:保存所有的临时表和临时存储过程及临时生成的表

      3、Model数据库:用于在系统上创建的所有数据库的模板

      4、Msdb数据库:供SQL SERVER代理程序高度警报、作业及记录操作
(三)示例数据库:
PubsNorthwind


七、创建和管理数据库(掌握)

(一)创建数据库:

      1、数据库的文件结构:一个数据库至少要包括一个数据库文件和一个事务日志文件

         A.数据库文件(DATABASE FILE):存放数据库数据和数据库对象的文件,一个数据库可包括多个数据库文件,一个数据库文件只属于一个数据库,数据库文件可分为主数据库文件(PRIMARY DATABASE FILE)和次数据库文件,前者用于存储数据库的启动信息,扩展名为.mdf,后者扩展名为.ndf


        B.事务日志文件(TRANSACTION LOG FILE):用来记录数据库的更新情况,扩展名为.ldf,一个数据库可有多个事务日志文件。


        C.文件组(FILE GROUP):类似于文件夹,主要用于分配磁盘空间并进行管理,可分为主文件组(PRIMARY FILE GROUP)和次文件组(SECONDARY GROUP FILE



      2、在企业管理器中创建数据库:

         方法:在“数据库”上右击“新建数据库”,会弹出相应对话框

         1)“常规”选项卡:可设定数据库的名称,可为中文

         2)“数据文件”选项卡:

             A.文件名:数据库的物理文件名

             B.位置:数据库的物理位置
             C.初始大小:新建数据库时的空间
             D.文件组:所属的文件组
             E.文件自动增长:在数据增加后是否允许数据库空间进行自动增长,可分为按
%增长和按MB增长

             F.最大文件大小:在数据增长后,是否限定数据库的最大空间

         3) “事务日志”选项卡:设置同“数据文件”选项卡


(二)收缩数据库:
      当数据库数据因更新而出现太多空闲空间时,对数据库文件空间进行缩减,避免空间浪费

      方法:右击需要进行操作的数据库,选择“所有任务”“收缩数据库”


(三)移动数据库:

      当数据库文件需要在不同主机间转移时进行的操作,在移动数据库前要对主机上的数据库进行“分离”操作,“分离”后,将数据库文件直接拷贝到目标主机上,再进行“附加”数据库操作即可

      1、“分离”数据库的方法:右击需要进行操作的数据库,选择“所有任务”“分离数据库”

      2、“附加”数据库的方法:右击“数据库”,选择“所有任务”“附加数据库”,选择数据库文件的位置即可


(四)配置数据库选项:
      对数据库的相关选项进行配置,右击要进行配制的数据库,选择“属性”,选择“选项”选项卡,主要选项如下:

      1、访问限制:若选择“
DB_OWNER, DBCREATOR, SYSADMIN的成员”,则代表只有数据库所有者数据库创建者和系统管理员才有权使用数据库,若选择“单”用户,表示数据库在同一时间只能借一个用户使用。
      2、只读:只能读取,查看,不能修改。

      3、ANSI Null
默认设置:允许在数据库表中输入NULL
      4、自动关闭:当无用户使用数据库时,自动关闭数据库
自动收缩:定期检查数据库,当未用空间超过其大小的25%时,自动进行收缩操作

(五)删除数据库:
      将不使用的数据库删除,右击需要删除的数据库,选择“删除”,删除后不可恢复
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to register multiple accounts on Xiaohongshu? Will I be discovered if I register multiple accounts? How to register multiple accounts on Xiaohongshu? Will I be discovered if I register multiple accounts? Mar 25, 2024 am 09:41 AM

As a platform integrating social networking and e-commerce, Xiaohongshu has attracted more and more users to join. Some users hope to register multiple accounts to better experience interacting with Xiaohongshu. So, how to register multiple accounts on Xiaohongshu? 1. How to register multiple accounts on Xiaohongshu? 1. Use different mobile phone numbers to register. Currently, Xiaohongshu mainly uses mobile phone numbers to register accounts. Users sometimes try to purchase multiple mobile phone number cards and use them to register multiple Xiaohongshu accounts. However, this approach has some limitations, because purchasing multiple mobile phone number cards is cumbersome and costly. 2. Use email to register. In addition to your mobile phone number, your email can also be used to register a Xiaohongshu account. Users can prepare multiple email addresses and then use these email addresses to register accounts. but

How to register a Manwa Comics account How to register a Manwa Comics account Feb 28, 2024 am 08:00 AM

On the Manwa Comics platform, there are rich comic resources waiting for everyone to explore. As long as you easily enter the official platform of Manwa Comics, you can enjoy all kinds of wonderful comic works. Everyone can easily find their favorite comics to read according to their own preferences. So how to register the official account of Manwa Comics? The editor of this website will bring you this detailed tutorial guide, hoping to help everyone in need. Manwa Comics-Official entrance: https://fuw11.cc/mw666 Manwa Comics app download address: https://www.siemens-home.cn/soft/74440.html Manwa Comics non-mainland area entrance: https: /

Remote Desktop cannot authenticate the remote computer's identity Remote Desktop cannot authenticate the remote computer's identity Feb 29, 2024 pm 12:30 PM

Windows Remote Desktop Service allows users to access computers remotely, which is very convenient for people who need to work remotely. However, problems can be encountered when users cannot connect to the remote computer or when Remote Desktop cannot authenticate the computer's identity. This may be caused by network connection issues or certificate verification failure. In this case, the user may need to check the network connection, ensure that the remote computer is online, and try to reconnect. Also, ensuring that the remote computer's authentication options are configured correctly is key to resolving the issue. Such problems with Windows Remote Desktop Services can usually be resolved by carefully checking and adjusting settings. Remote Desktop cannot verify the identity of the remote computer due to a time or date difference. Please make sure your calculations

What is the difference between HQL and SQL in Hibernate framework? What is the difference between HQL and SQL in Hibernate framework? Apr 17, 2024 pm 02:57 PM

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

How to register a Xiaohongshu account? What is required to register a Xiaohongshu account? How to register a Xiaohongshu account? What is required to register a Xiaohongshu account? Mar 22, 2024 am 10:16 AM

Xiaohongshu, a social platform integrating life, entertainment, shopping and sharing, has become an indispensable part of the daily life of many young people. So, how to register a Xiaohongshu account? 1. How to register a Xiaohongshu account? 1. Open the Xiaohongshu official website or download the Xiaohongshu APP. Click the "Register" button below and you can choose different registration methods. Currently, Xiaohongshu supports registration with mobile phone numbers, email addresses, and third-party accounts (such as WeChat, QQ, Weibo, etc.). 3. Fill in the relevant information. According to the selected registration method, fill in the corresponding mobile phone number, email address or third-party account information. 4. Set a password. Set a strong password to keep your account secure. 5. Complete the verification. Follow the prompts to complete mobile phone verification or email verification. 6. Perfect the individual

How to register a Xiaohongshu account? How to recover if its account is abnormal? How to register a Xiaohongshu account? How to recover if its account is abnormal? Mar 21, 2024 pm 04:57 PM

As one of the most popular lifestyle sharing platforms in the world, Xiaohongshu has attracted a large number of users. So, how to register a Xiaohongshu account? This article will introduce you to the Xiaohongshu account registration process in detail, and answer the question of how to recover Xiaohongshu account abnormalities. 1. How to register a Xiaohongshu account? 1. Download the Xiaohongshu APP: Search and download the Xiaohongshu APP in the mobile app store, and open it after the installation is complete. 2. Register an account: After opening the Xiaohongshu APP, click the "Me" button in the lower right corner of the homepage, and then select "Register". 3. Fill in the registration information: Fill in the mobile phone number, set password, verification code and other registration information according to the prompts. 4. Complete personal information: After successful registration, follow the prompts to complete personal information, such as name, gender, birthday, etc. 5. Settings

Usage of division operation in Oracle SQL Usage of division operation in Oracle SQL Mar 10, 2024 pm 03:06 PM

"Usage of Division Operation in OracleSQL" In OracleSQL, division operation is one of the common mathematical operations. During data query and processing, division operations can help us calculate the ratio between fields or derive the logical relationship between specific values. This article will introduce the usage of division operation in OracleSQL and provide specific code examples. 1. Two ways of division operations in OracleSQL In OracleSQL, division operations can be performed in two different ways.

How to register a qooapp account How to register a qooapp account Mar 19, 2024 pm 08:58 PM

qooapp is a software that can download many games, so how to register an account? Users need to click the "Register" button if they don't have a pass yet, and then choose a registration method. This account registration method introduction is enough to tell you how to operate it. The following is a detailed introduction, so take a look. How to register a qooapp account? Answer: Click to register, and then choose a registration method. Specific methods: 1. After entering the login interface, click below. Don’t have a pass yet? Apply now. 2. Then choose the login method you need. 3. You can use it directly after that. Official website registration: 1. Open the website https://apps.ppaooq.com/ and click on the upper right corner to register. 2. Select registration

See all articles