How i can stop SQL server 2008 Express from Startup in Windows ? - database

i am installing SQL server 2008 express and found that many exe run on startup even i not used them.
can i stop them or allow to run them only after when i want to run them. means when i want only that time those run otherwise not.
how i can remove them from startup

You can see all your SQL server instances from the Sql Server Configuration Manager if you have it. There you can set the startmode to Manual instead of Automatic. This can also be done from the services console as arunkumar said. The service should be named SQL Server (SQLEXPRESS).

As #arunkumar said, you can change the services to disabled, or you can set them to Automatic also, but that may not change much. Generally, SQL Server is usually the main purpose of the PC, so it thinks it always needs to run :)

First thing will be to setup all those SQL Server and related services to run "Manually" instead of "Automatic" using Sql Server Configuration Manager.
I usually create two batch files, one to start SQL Server and related services like net start MSSQLSERVER and another to stop SQL Server when I am not using it like net stop MSSQLSERVER.
Of course there will be other related services as well.
If you can't stop services as you indicated in one of your reply, then may be you don't have enough privileges to perform that operation ??

Try:
run CMD "Run as Administrator"
command STOP
net stop mssql$express ,
command START
net start mssql$express

Related

Microsoft SQL Server , Error : 87

I am really tired, it's been 3 days that I can't open my SQL Server Management Studio. I got connection string error with number 87. Below screenshot show my problem:
And I use localhost\MSSQLSERVER with error 87 and Arash-PC (my machine name) with error number 2.
And I tried sqlcmd -U sa -S Arash-PC too
You need to check in your SQL Server Configuration Manager what services and instances you have installed. Go to Start Menu > All Programs > Microsoft SQL Server (version) > Configuration Tools and launch the appropriate Configuration Manager. You should see a screen something like this:
Find the SQL Server (.....) service(s), and make sure the service is started.
If you find a SQL Server (MSSQLSERVER) service started, then you have a (unnamed) default instance to which you can connect using
.
(local)
Arash-PC
You MUST NOT supply the MSSQLSERVER as the instance name!
If you find any other SQL Server (instance name) service started (e.g. SQL Server (SQLEXPRESS) in my screenshot), then the instance name (SQLEXPRESS) needs to be appended to the server name to connect to that instance:
.\SQLEXPRESS
(local)\SQLEXPRESS
Arash-PC\SQLEXPRESS
Make sure you are not running out of space on the drive where SQL is installed. Try rebooting as well.
Verify that the SQL Server (MSSQLSERVER) service is started. Click Start, click Administrative Tools, click Services, and scroll to SQL Server (MSSQLSERVER). If it is not started, right-click the service, select Properties, in Startup Type select Automatic, click Apply, click Start, and then click OK. Make sure service started. If service did not start - you need to analyze event log. Alternatively - try reinstalling/repairing SQL server.
Make sure you have no network problems - try temporary disabling any firewalls(including Windows Firewall) and antiviruses.
If service is started and firewalls disabled but still no luck - time to check SQL Server Configuration Manager settings. In detail it is described here and here. Shortly I would recommend first enable all protocols in both server and client sections. Reboot. Check it works. If that would not help - then try disabling everything apart from TCP/IP (both server and client sections). Reboot again.
If above does not help - try reinstalling SQL Server. Just make sure you have saved your databases 1st. To save them - stop sql server service, and copy your *.mdf and *.ldf (from SQL server Data folder) files to safe location. Later on you can attach them. If you are not sure where your SQL server Data folder located - just search for files with mdf extension.
Edit:
Successful telnet showing SQL server port is up looks this way:
Edit2:
Launch Event Viewer:
Click System, then Filter Current Log:
Setup filter as shown below:
Then look for SQL-related events:
Usually event text provides information why MSSQLSERVER service fails to start. If the text is unclear please google it for more details.
If your problem was the same as mine (or to anyone else whose attempting to connect to their MS SQL Server w/ a similar connection string), MSSQLSERVER is the default instance name when you set it up, if you don't provide an instance name. I omitted the MSSQLSERVER from the connection string and I was successfully able to connect.
With all respect to "Anton Kruglov" and "marc_s" , Unfortunately, my problem is not resolved . I had to change my windows and reinstall softwares . Now it works properly .

Can not connect to SQL Server instance in my PC

I stopped SQL Server (MSSQLSEVER) and SQL Server Agent services and deleted the backup file and data file was located at C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL. Log file is still there:
Now I can't connect to SQL Server
Can not start SQL Server (MSSQLSERVER) and SQL Server Agent services as well
Could you suggest me a solution to connect to my SQL Server instance?
Image of the error message:
I really do not have enough information to diagnose this issue.
However, I have two ideas of what you did.
1 - What you showed me in the picture is the data and log directories. They contain all the system databases by default. See image below.
If you have not done a shift delete of the files and directory, stop the sql server instance and recover them from the recycle bin and restart the sql server instance.
Be VERY careful when deleting directories.
If you do not have these files handy, you might have to re-install SQL Server.
2 - If you data files are in another directory, which I doubt. Then, look in the windows event log and/or sql error log for errors. Please post more details.
J
You're not going to be able to connect to the SQL until the agent service is running again.
I think I need more information about what happens when you try to start the service. Also, I'd probably (if possible) try to restart the machine. Though that probably shouldn't be necessary, dependent on OS you're running it might help.
If you could post what happens when you try to start the service, that might be helpful.
Is the SQL service running? The agent service is not required for connecting to an instance. To regain access to SQL server after deleting required files, read the following msdn article: https://msdn.microsoft.com/en-us/library/dd207004(v=sql.120).aspx

SQL Server 2008 R2 can't connect to local database in Management Studio

I am using SQL Server 2008 R2 Express.
I first installed SQL Server 2008 R2 Express Management Studio and then I installed SQL Server 2008 R2 Express. I have the instance SQLEXPRESS running and it is set to automatic.
I am trying to connect to it locally using Windows authentication - server name is set to local and the username is grayed out and set to my profile username.
When I try to connect I get the following error:
Have I installed the wrong SQL Server Management Studio?
If your instance is called SQLEXPRESS, then you need to use .\SQLEXPRESS or (local)\SQLEXPRESS or yourMachineName\SQLEXPRESS as your server name - if you have a named instance, you need to specify that name of the instance in your server name.
Your "SQL Server Browser" service has to be started too.
Browse to Computer Management > Services.
Find find "SQL Server Browser"
set it to Automatic
and also Manually start it (2)
Hope it helps.
Follow these steps to connect with SQL Server 2008 r2 (windows authentication)
Step 1: Goto Control Panel --> Administrator Tools --> Services
select SQL SERVER (MSSQLSERVER) and double click on it
Step 2:
Click on start Service
Step 3:
Now login to SQL server with Windows authentication
and use user name : (local)
Enjoy ...
I also received this error when the service stopped. Here's another path to start your service...
Search for "Services" in you start menu like so and click on it:
Find the service for the instance you need started and select it
(shown below)
Click start (shown below)
Note: As Kenan stated, if your services Startup Type is not set to Automatic, then you probably want to double click on the service and set it to Automatic.
I know, this problem can be faced by so many people and many of them have uninstalled and re-installed the sql server for resolving this issue.
In my observation the problem of not connecting the database service locally is just because of your network connection you are using, in most of the cases these problems will come when you are using wi-fi network.
Solution is, if you are using wi-fi then just right click on status of the network and get the ip details and enter the same ip in sql server name,
it will work.
Regards
Vishwajeet
I have the same error but with different case. Let me quote the solution from here:
Luckly I also have the same set up on my desktop. I have installed
first default instance and then Sql Express. Everything is fine for
me for several days. Then I tried connecting the way you trying, i.e
with MachineName\MsSqlServer to default instance and I got exctaly the
same error.
So the solution is when you trying to connect to default instance you
don't need to provide instance name.(well this is something puzzled
me, why it is failing when we are giving instance name when it is a
default instance? Is it some bug, don't know)
Just try with - PC-NAME and everything will be fine. PC-NAME is the
MSSQLServer instance.
Edit : Well after reading your question again I realized that you are
not aware of the fact that MSSQLSERVER is the default instance of Sql
Server. And for connecting to default instance (MSSQLSERVER) you
don't need to provide the instance name in connection string. The
"MachineName" is itself means "MachineName\MSSQLSERVER".
Lots of the above helped for me, plus the accepted answer, but since I was on an EC2 instance, I had no idea what my instance name was. Finally, I opened SQLServer Configuration Manager and in the Name column, use whatever is there as your connection server, so in my case, .\EC2SQLEXPRESS and worked great!
Okay so there might be various reasons behind Sql Server Management Studio's(SSMS) above behaviour:
1.It seems that if our SSMS hasn't been opened for quite some while, the OS puts it to sleep.The solution is to manually activate our SQL server as shown below:
Go to Computer Management-->Services and Applications-->Services. As you see that the status of this service is currently blank which means that it has stopped.
Double click the SQL Server option and a wizard box will popup as shown below.Set the startup type to "Automatic" and click on the start button which will start our SQL service.
Now check the status of your SQL Server. It will display as "Running".
Also you need to check that other associated services which are also required by our SQL Server to fully function are also up and running such as SQL Server Browser,SQL Server Agent,etc.
2.The second reason could be due to incorrect credentials entered.So enter in the correct credentials.
3.If you happen to forget your credentials then follow the below steps:
First what you could do is sign in using "Windows Authentication" instead of "SQL Server Authentication".This will work only if you are logged in as administrator.
Second case what if you forget your local server name? No issues simply use "." instead of your server name and it should work.
NOTE: This will only work for local server and not for remote server.To connect to a remote server you need to have an I.P. address of your remote server.
I had this problem. My solution is: change same password of other in windowns. Restart Service (check logon in tab Service SQL).

Moving MSDB, can't access single user mode

I am attempting to move msdb (SQL Server 2005) by using the instructions here:
http://support.microsoft.com/kb/224071
However, when I start SQL Server in single user mode, I have no way to access the database. I have tried starting sqlcmd from the console (and also for good measure tried starting ssms), but I'm unable to get into any tool to do my work because it says it is in single user mode and only one administrator can be logged in. In the services console I see no other SQL Server related processes running, so what is preventing me from getting in?
Thanks...
Some application is stealing the only connection available. See Starting SQL Server in Single-User Mode for a tip how to prevent that:
When you use the -m option with sqlcmd or Management Studio, you can
limit the connections to a specified client application. For example,
-m"sqlcmd" limits connections to a single connection and that
connection must identify itself as the sqlcmd client program. Use this
option when you are starting SQL Server in single-user mode and an
unknown client application is taking the only available connection. To
connect through the Query Editor in Management Studio, use
-m"Microsoft SQL Server Management Studio - Query".

What's the best way to start and stop SQL Server from the command line?

I need to start and stop SQL Server from the command line. I am willing to write a small C# program if necessary, but I suspect that there's something (PowerShell, maybe?) that currently exists that does this gracefully.
Thank you.
net {start|stop} mssqlserver
net start/stop
http://technet.microsoft.com/en-us/library/cc736564.aspx
Or, in PowerShell, Stop-Service, Start-Service, or Restart-Service. Note that all of this has to be done on a per-instance basis, just as with the other suggestions here.
http://msdn.microsoft.com/en-us/library/ms187463.aspx
Here's an answer that actually contains a little bonus information...and more thoroughly answers the question. What if you have more than one instance of SQL server? Then you need to know the extended syntax of NET START. You can start services by Name, not just by service moniker (or whatever mssqlserver is an example of):
NET START "sql server (instancename)"
This applies to other services, too. Want to start the System Event Notification Service?
NET START "System Event Notification Service"
Boom goes the dynamite! hehe
For restarting SQL Server and SQL Server Agent you can create a batch file called restartsql.bat with the following commands in it, save it, and run it when needed:
#ECHO OFF
net stop "SQL Server Agent (MSSQLSERVER)"
net stop MSSQLSERVER
net start MSSQLSERVER
net start "SQL Server Agent (MSSQLSERVER)"
Enjoy!
With the commands below, I could start and stop SQL Server 2019 Express:
net start "SQL Server (SQLEXPRESS)"
net stop "SQL Server (SQLEXPRESS)"
You can find the actual name of SQL Server on SQL Server Configuration Manager as shown below:
And, this is How to find and open SQL Server Configuration Manager.

Resources