Saturday, January 25, 2020

SQL Server Basics Commands

SQL Server Basics Commands



How to create a database in SQL Server ?

Creating a new database using the CREATE DATABASE statement
The CREATE DATABASE statement creates a new database. The following shows the minimal syntax of the CREATE DATABASE statement:
CREATE DATABASE database_name;
CREATE DATABASE mqmprod;

Creating a new database using SQL Server Management Studio
First, right-click the Database and choose New Database… menu item.

How to check the database status of SQL Server?

This statement lists all databases in the SQL Server:
SELECT name FROM master.sys.databases ORDER BY name;
(or)
EXEC sp_databases;
(or)
sp_helpdb;

How to connect to a database in SQL Server?

USE database_name;
use mqmprod;

No comments:

Post a Comment