Create database using t-sql in sql server 2008

Go down

Create database using t-sql in sql server 2008

Post by Admin on Thu Feb 20, 2014 3:50 pm

There are many ways to create database in sql server, so let me give you a few examples on how to create a simple database using t-sql.

USE Master
GO
CREATE DATABASE DBINTSQL
ON
(
 NAME = 'BDINTSQLSERVER_DB',
 FILENAME ='C:\Program Files\Microsoft SQL Server\TATABASE\BDINTSQLSERVER_DB.mdf'
 ,SIZE = 200MB
)
LOG ON
(
 NAME = 'BDINTSQLSERVER_LG',
 FILENAME ='C:\Program Files\Microsoft SQL Server\LOG\BDINTSQLSERVER_LG.ldf'
 ,SIZE = 20MB
)
Just like that you create a simple database, and one thing to keep in mind is that it is a good practice to have the database file and and the log file in separate disk.
avatar
Admin
Admin

Posts : 9
Join date : 2013-10-16
Age : 33

View user profile http://forensicsblog.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum