SQL and T-SQL

|
Rather Have Fast and Secure Remote
Control?
|
One last thing to notice about this script is the CREATE DATABASE statement itself. More specifically, we don’t have to specify every option available. For the options we did not specify, SQL server will use default values. Also when we set the SIZE of the files, we don’t have to specify MB because MB is the default for the SIZE value (although for readability you may want to add MB anyway).
Once you have entered the statement, select Execute from the Query menu to see this output.
That’s it! We now have a new database created on our SQL Server.
You can also use the ALTER DATABASE statement to modify an existing database. For example, the following statement would add a new data file to the DBbySQL database with a size of 5MB and a Max size of 50MB:
USE master
GO
ALTER DATABASE DBbySQL
ADD FILE
(
NAME = DBbySQL_data2,
FILENAME = 'c:\DBbySQL_data2.ndf',
SIZE = 5MB,
MAXSIZE = 50MB
)
GO
For more information on the ALTER DATABASE statement see “ALTER DATABASE” in the SQL Server Books Online.
Written by Mike Aubert - Visit WebsiteNext post in SQL Server:
Introduction to SQL Server Transaction Logs
Next post in Database:
Introduction to SQL Server Transaction Logs
Next post in Programming:
Basic Linux Shell Scripting Concepts
Previous post in SQL Server:
Creating a SQL Server Database
Previous post in Database:
Creating a SQL Server Database
Previous post in Programming:
VBScript Fundamentals for Windows Scripting – WMI
All Tutorials by Category:
- CCDA Study Guide
- CCNA Study Guide Chapter 01
- CCNA Study Guide Chapter 02
- CCNA Study Guide Chapter 03
- CCNA Study Guide Chapter 04
- CCNA Study Guide Chapter 05
- CCNA Study Guide Chapter 06
- CCNA Study Guide Chapter 07
- CCNA Study Guide Chapter 08
- CCNA Study Guide Chapter 09
- CCNA Study Guide Chapter 10
- CCNA Study Guide Chapter 11
- CCNA Study Guide Chapter 12
- Cognos
- Computer Hardware
A
C
D
E
F
G
H
I
L
M
N
Entire site Copyright © 1999-2007 2000Trainers.com, all rights reserved.
Content on this site may not be copied or reproduced in any way without permission.


