Showing posts with label learning. Show all posts
Showing posts with label learning. Show all posts

Friday, March 30, 2012

instance of sql server

I am learning SQL Server 2005 and I was told to install a second instance of
SQL Server 2005 on my machine. How can I install a second instance of SQL
Server 2005 on my machine

I already installed SQL Server 2005, I guess this is my first instance. To
install a second instance, do I just run setup again?Yes, just run setup again to create a 'named' instance. Setup will ask you
for an instance name.

A computer can have up to 1 default instance (probably what you installed
initially) but many named instances. To connect to the default instance
after installation, specify only the computer name. For the named instance,
specify computer name and instance name separated by a backslash
('ComputerName\InstanceName').

--
Hope this helps.

Dan Guzman
SQL Server MVP

"David" <david_vcp@.hotmail.com> wrote in message
news:bMKdnc_BtsngZ9fZRVn-rg@.comcast.com...
>I am learning SQL Server 2005 and I was told to install a second instance
>of SQL Server 2005 on my machine. How can I install a second instance of
>SQL Server 2005 on my machine
> I already installed SQL Server 2005, I guess this is my first instance.
> To install a second instance, do I just run setup again?

Sunday, February 19, 2012

Installing SQL

I am learning ASP.NET from teach yourself ASP.NET in 24 hours. When i try to connect to the SQL Server i get an error "SQL Server does not exist or access denied".

SQL appears to exist, and to be running. I am trying to connect through Localhost.

Where should i be looking if access is being denied by a firewall and how should i disable it

Connection to local SQL always uses Shared Memory Network Library by default, which should not be blocked. Please post your error message and connection string.

|||

Hi Lori-Jay

The message is:

Unable to connect to database server.

SQL does not exist or access denied.

ConnectionOpen(Connect())

|||Hi, did you forget to post your connection string?Smile [:)]|||

Hi,

Where do i find the connection string? I am simply using the example in the book which gives me some buttons and text boxes to fill in.

These are

SQL Server authentication button on

User name which I completed as instructed as SA

And the password which I used to install MSDE

And then I hit "Create a new database"

I then got the error above.

Where would I find the connection string?

|||

So you're using MSDE, thus leads us closer to the answer. Are you using ASP.NET 2.0? Sorry I'm not familiar with the example you mentioned, so if possible please give a link that I can follow to try the sample. Is it something like this?

http://download.microsoft.com/download/C/3/8/C3888A3E-52F8-4FE9-8E41-89150AB0302F/CreateDB.zip.exe

If yes, please open to sample solution with VS2005 and right click the form where you create the database (Form1.vb in this sample) in Solution Explorer, choose View Code. You should see some code like this:

Public Class Form1

' Initialize constants for connecting to the database
' and displaying a connection error to the user.
Protected Const SqlConnectionString As String = _
"Server=(local);" & _
"DataBase=;" & _
"Integrated Security=SSPI"

Protected Const ConnectionErrorMessage As String = _
"To run this sample, you must have SQL " & _
"installed. For " & _
"instructions on installing SQL, view the documentation file."

Protected didPreviouslyConnect As Boolean = False
Protected didCreateTable As Boolean = False
Protected connectionString As String = SqlConnectionString

.....

And explorer the 'Create database section you'll find this line which gets connectionString:

Dim connection As New SqlConnection(connectionString)

As we can see the default connection is made to local default SQL instance. So what you need to do is customizing the const that host connection string to point to your MSDE server name. For example:

"Server=myServer\myMSDESvr;" & _
"DataBase=;" & _
"Integrated Security=SSPI"