Akshay Soam
Akshay Soam

Reputation: 1620

Server Name in SQL Server

I'm new to SQL Server programming and I'm stuck with setting server name and database name at the time of setup. I have tried many websites but I'm not able to understand. I'm currently using Visual Studio 2013. I haven't created any database at the first time of installation then how can i enter the database name? I'm confused with this.

When I click on test connection it show the error 40: failed to establish a connection.

Secondly there is no folder visible for database diagram in Visual Studio 2013. Can you tell me how to make it visible.

Thank You

Upvotes: 0

Views: 2421

Answers (2)

brazilianldsjaguar
brazilianldsjaguar

Reputation: 1449

You mention you're stuck at 'time of setup'. Were you the one who installed SQL Server on the machine? If you're attempting to use Visual Studio 2013 to connect to a SQL Server instance that hasn't been installed yet, you're going to continue to have all kinds of trouble.

Assuming your SQL Server is up and running with the default instance name, you can choose the server localhost and the database master, as those always exist. At that point, you'd be able to run CREATE DATABASE statements, etc, to build up your table design.

If you need help installing SQL Server that's another question with other answers.

Upvotes: 1

vintastic
vintastic

Reputation: 745

If you are using VS2013, go to menu option:

View/Server Explorer

Then you will see Data Connections which will probably be blank. Right Click the "Data Connections" text and select "Add Connection"

The source should say Microsoft SQL Server(SqlClient)

In Visual Studio 2013 you can create a local database.

In the Server name field type

(LocalDb)\v11.0

Use Windows Authentication.

Press "Test Connection".

It will take a second to start the server, and you should be connected.

Upvotes: 2

Related Questions