SQL Server from getting started mastering----database related

Source: Internet
Author: User

     operation of the digital data

 UseMasterGoIF EXISTS(SELECT *  fromsysdatabasesWHERENAME='QZone')--determine if the database existsBEGIN  --represents the beginning of a statement block (DROP DATABASEQZone--Delete Database First if database existsEND  --represents the end of a statement block)GO CREATE DATABASEQZone--The following does not write the words using the default configuration on PRIMARY --creating the primary database file(NAME='QZone',--file name Logical nameFILENAME='E:\Databases\QZone.dbf',--Save PathSIZE=5MB,--file initial value sizeMaxSize=50MB,--Maximum file sizeFileGrowth=1MB--value that exceeds the current file size from the growth file size) LOG  on --Create a log file(NAME='QZone', FileName='E:\Databases\QZone.ldf', Size=2MB, MaxSize=50MB, FileGrowth=1MB)GO  EXECSp_renamedb'QZone','Qqzone';GOEXECSp_renamedb'Qqzone','QZone';GO--Renaming the database (this name does not change the database file name: Log file name)
View Code

SQL Server from getting started mastering----database related

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.