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