online training

Create a Database by Script

SQL Server accepts Transact-SQL (which is an extended version of the SQL standard), so you could create the database by running the following SQL script.

USE master;
GO
CREATE DATABASE Music;
GO

To do this, open a new query by clicking New Query in the toolbar and run an SQL CREATE DATABASE statement.

Just as you can specify certain properties when creating a database via the GUI, you can include those same properties when creating a database by script. Here’s an example of specifying settings for the data and log files.

USE master ;
GO
CREATE DATABASE Music
ON
( NAME = Music_dat,
FILENAME = ‘C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\Music.mdf’,
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = Music_log,
FILENAME = ‘C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\Music_log.ldf’,
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB ) ;
GO

How to Connect to SQL Server after Installation

This video explains on “How to Connect to SQL Server after Installation”

Applicable for SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, SQL Server 2014 and SQL Server 2016

T0 resolve possible connection issues at basic level, ensure the following:

1. Verify and ensure correct server name is provided

2. Go to Run then services.msc then ensure SQL Server service for the respective instance is started.

Any clarifications: Please email to contact@sqlschool.com

For Real-time Trainings and Projects, Placements on SQL Server, please visit http://www.sqlschool.com

Or call us on +91 9666440801 (INDIA) or +1 510-400-4845 (USA/CANADA)