Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Local SQL Server database

Tags:

sql

sql-server

I've used SQL Server Management Studio before, but only when the server is already up and running.

I need to start from the beginning and create my own instance on the local computer.

The instructions I'm getting, is just put "." on the server name and use Windows Authentication. But that gives me a "server not found" error.

Can someone please help? I'm using SQL Server 2012 Management Studio.

I really thought it would be just like Access, create my tables and start creating queries.

like image 506
gemmo Avatar asked Apr 11 '17 20:04

gemmo


People also ask

Can you have a local SQL database?

An instance of SQL Server Express LocalDB is an instance created by a user for their use. Any user on the computer can create a database using an instance of LocalDB, store files under their user profile, and run the process under their credentials. By default, access to the instance of LocalDB is limited to its owner.

How do I setup a local SQL Server in Windows 10?

After installation you need to connect to Server Name : localhost to start using the local instance of SQL Server. Once you are connected to the local instance, right click on Databases and create a new database.

How do I start SQL local database?

In the Command Prompt window, type the following command: SqlLocalDB create NewInstance and press the Enter key. The message will appear which indicates that the LocalDB instance is created: LocalDB instance “NewInstance” created with version 13.0. 2186.6.


1 Answers

You need to install a so-called Instance of MSSQL server on your computer. That is, installing all the needed files and services and database files. By default, there should be no MSSQL Server installed on your machine, assuming that you use a desktop Windows (7,8,10...).

You can start off with Microsoft SQL Server Express, which is a 10GB-limited, free version of MSSQL. It also lacks some other features (Server Agents, AFAIR), but it's good for some experiments.

Download it from the Microsoft Website and go through the installer process by choosing New SQL Server stand-alone installation .. after running the installer.

Click through the steps. For your scenario (it sounds like you mainly want to test some stuff), the default options should suffice.

Just give attention to the step Instance Configuration. There you will set the name of your MSSQL Server Instance. Call it something unique/descriptive like MY_TEST_INSTANCE or the like. Also, choose wisely the Instance root directory. In it, the database files will be placed, so it should be on a drive that has enough space.

Click further through the wizard, and when it's finished, your MSSQL instance will be up and running. It will also run at every boot if you have chosen the default settings for the services.

As soon as it's running in the background, you can connect to it with Management Studio by connecting to .\MY_TEST_INSTANCE, given that that's the name you chose for the instance.

like image 192
Nico R Avatar answered Sep 29 '22 09:09

Nico R