How do I map (local) to a non-standard named SQL Server? - sql-server

I installed SQL Server 2008 (SQL Server 2005 was already installed) on my XP box and name the local instance of the database so that it wouldn't clash with SQL Server 2005.
Now I want to change the mapping of (local) from SQL Server 2005 to my non-standard named SQL Server 2008 instance. Anybody know how to do this?

I'm afraid Mladen is correct.
You can move the db's from one
instance to another using
attach/detach or backup/restore.
You can transfer all logins (if
needed) with this method.
You can move SQL Agent scripts by
right-clicking on them on the existing server and selecting
generate script then running that
script on the new server.
.
You will have to do the following (Assuming you'd like to make 2008 your default instance):
Install 2005 named instance.
Move the default to the named using above method.
Uninstall 2005 default instance.
Install 2008 default instance.
Move the named to the default using above method.
Uninstall 2008 named instance.
Good luck!

nope. you'll have to reinstall both.

Create an alias in the sql config manager. Enable named pipes for your instance with surface area config and you will be in business.

Related

How to create first Server Instance in SSMS

I have installed SQL Server and SSMS. And I open SSMS. The Connect to Database Engine Dialog is shown. But the Server Name is empty.
I don't know how to create a Server Name.
And I don't know where.
I also have tried to choose a fullpath name or local. But that doesn't work.
Can anybody help me? Oh... for both (SQL Server Express plus Management Studio I have the latest version).
In the drop down box for "Server Name" choose the option for <Browse for more...>. This will then give you a further window where you should see your instance listed under Local Servers:
One of the following:
You have installed Sql Server (not just SSMS), and during installation you specified a SQL Server instance for your computer and you DIDN'T specify an instance name. In that case you must
Make sure that the SQL Server service, called MSSQLSERVER, is running.
Connect to it with the name . (yes, just a dot)
You have installed Sql Server, and during installation you specified a SQL Server instance for your computer and you DID specify an instance name. In that case you must
Make sure that the SQL Server service, called MSSQLSERVER, is running.
Connect to it with the name .\InstanceName
You have install Sql Server Express.
Make sure that the SQL Server Express service is running. (I think the service name is also MSSQLSERVER)
Connect to it with the name .\SqlExpress
You have not installed any Sql Server version but you may have installed Visual Studio or something that include Sql tools, including LocalDb
start a localdb instance running with a command that is something like this (depending on your installed version):
'C:\Program Files\Microsoft SQL Server\150\Tools\Binn\SqlLocalDB.exe' start
Connect to it with the name, (localdb)\MSSQLLocalDb
You have not installed any Sql Server instance on your machine, and you are expecting to find a Sql Server instance somewhere on your network.
In this case you need someone who knows, to tell you the server name.
(You can create and start localdb instances with other names, MSSQLLocalDb is just the default or not having specified a name)
Start a service with e.g. PowerShell: Start-Service MSSQLSERVER or look for the service in the Windows' ⚙️ Services GUI you can find from Start Menu search.

Correct Format of "Server Name" for connecting to LocalDB SQL Server Named Instance

I have installed LocalDB option with SQL Server Express and I also have created it with a named instance of LOCALDBSERVER.
But in SQL Server Management Studio in the Server Name section I enter:
(localdb)\LOCALDBSERVER
and it cannot connect to it. But if I type .\LOCALDBSERVER then it connects.
What am I doing wrong and what is the difference?
I have attached the screenshots I took from this LOCALDBSERVER while I was installing it:
The installation screenshot looks like you installed another instance of SQL Server Express Edition, named LOCALDBSERVER. This is a named instance of SQL Express, not a localdb instance.
One way to create a localdb instance named LOCALDBSERVER is with the sqllocaldb utility (assuming you have installed the localdb feature):
sqllocaldb create LOCALDBSERVER
You can then connect from SSMS with the '(localdb)\LOCALDBSERVER' specification.

I have 2 instances of SQL Server Express installed, but TFS has selected the wrong one. No way to point it to the right one?

I've installed TFS Express on my laptop. I already had SQL Server 2016 Express installed. When I run the TFS configuration wizard, I'm getting the following error (The version I am using cannot be upgraded - see screenshot):
According to this link, I need SQL Server 2012 to run the TFS Express 2015. That's what I did. I tried to configure again. However, when I get to the same step, the wizard has already selected the SQL Server 2016 instance (see screenshot).
And, there's no way I can tell the Wizard to use the 2012 instance I've just installed.
Anyway to change the targeted SQL Server Express instance?
Thanks for helping
First of all, check the SQL requirement to see whether you have installed the correct SQL edition.
Then you can use TFSConfig.exe command to change a new SQL Server Instance:
tfsconfig unattend /configure /type:basic /inputs:SqlInstance=server\sqlInstanceName
When installing TFS to a pre-installed SQL instance you need to use the "Advanced" wizard and select the named instance.

How to create instance in SQL Server 2008

I have SQL Server 2005 Express installed. Later I upgraded to SQL Server 2008. I don't know much about instances, but when I log into SQL Server 2005 and I log into SQL Server 2008 it is showing the same number of databases. Also, when I create a database in SQL Server 2008 it is showing it in SQL Server 2005.
Any Idea how can I create a separate SQL Server 2008 instance?
If possible please explain step by step.
Thanks
An instance of a SQL Server database is just a named installation of SQL Server. The first one you install on any given machine typically is the default instance, which has no specific name - you just connect to it using the (local) name or the name of the server machine.
SQL Server Express typically installs as a SQLExpress instance - so the instance is called SQLExpress, and you connect to it using (local)\SQLExpress or .\SQLExpress or MyServerMachine\SQLExpress.
SQL Server instances are totally independent of one another, and you can basically install as many as you like - you just have to make sure to use unique instance names for each. But when you run the SQL Server Installation again, it will show you what instances are already installed, and prompt you for a new instance name for a new installation. No harm done.
Run the install program again, and when prompted whether you want a default or a named instance, specify a named instance with a different name. A default instance make looks like this:
servername
A named instance looks like this:
servername\instancename
"you can basically install as many as you like"
There are limitations, like 50 in 2008.
http://technet.microsoft.com/en-us/library/aa174516(v=sql.80).aspx
Microsoft does not support more than 16 instances on a single computer or failover cluster.
There are a few more limitations.

Importing a MDF file into SQL Server 2008?

I have inherited a VB.net web app that I'm making some changes on. I'm perfectly capable with the programming side (VB and MSSQL) but I'm getting lost with the tools. I was given a zip file of the code and everything. I opened the sln file in Visual Studio 2005 and it worked fairly easily with little modification.
Running the app works perfectly. Problem is, I need to write some new SPs so need the database admin. SQL Server 2008 Express is installed but it doesn't see any database and I have no idea how to import it.
I have a folder App_Data in the project with the file ASPNETDB.MDF. Opening this in VS gived the error:
This server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later.
Any ideas where to go from here?
You need to get Sql Server Management Studio. From there you should be able to connect to the instance of Sql Server Express running on your system and tell it to attach to the .mdf file. This will allow you to use that database from withing sql server and management studio, and you will be able to add your stored procedure. Just remember to detach again when you're done, or you won't be able to use the mdf file as you expect from your app.
Visual Studio uses SMO 2005 to connec to to SQL. The SMO 2005 will not connect to SQL 2008 by design. You need to either upgrade VS to VS 2008, or downgrade Express to Express 2005.
You can't attach mdf file made in SQL Server 2005 to a SQL Server 2008 instance. What you need is to install SQL Server 2005 Express, attach this file, backup database, then restore it on 2008 Server instance and detach the database. You will get properly created for 2008 Server mdf.

Resources