Create database using t-sql in sql server 2008
Page 1 of 1
Create database using t-sql in sql server 2008
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.
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.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum