SQL and T-SQL


By Mike Aubert, February 23rd, 2002 Posted in SQL Server. Subscribe to our RSS Feed



Rather Have Fast and Secure Remote Control?

 Securely access PCs and servers worldwide through any firewall. Try it and see for yourself!

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 Website

Go To Page: 1 2 3 4



Print This Post Print This Post













All Tutorials by Category:















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.





IT Showcase


Text Link Ads

View all Tutorials by Category: