I'm using SQL Server 2012 Express LocalDB. Instances seem to stop automatically after 10 minutes if there is no activity on them. Is there a clean way to keep an instance running forever?
相关问题
- sql execution latency when assign to a variable
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
- SQL to Parse a Key-Value String
相关文章
- Entity Framework 4.3.1 failing to create (/open) a
- Code for inserting data into SQL Server database u
- Delete Every Alternate Row in SQL
- Linux based PHP install connecting to MsSQL Server
- SQL Azure Reset autoincrement
- How do we alias a Sql Server instance name used in
- Is recursion good in SQL Server?
- How can I convert a OLE Automation Date value to a
The timeout is configurable via T-SQL with
'user instance timeout'
option:The timeout is expressed in minutes and has a maximum value of
65535
. I'm pretty sure you need to restart the instance after setting it. And don't try setting it to0
, it will just make the instance shut down immediately after starting, which will make it hard to set the value back to something useful :-).Source: this BOL article containing other useful information on User Instances that are applicable to LocalDB instances as well.
Final Remark
If you need something that's always running and starts whenever a computer starts you might just consider using regular, service-based, instance of SQL Server Express.
Here is how to do Krzysztof Kozielczyk's answer from the command line.
Start the
localdb
instance.Get the server path, which is the Instance pipe name.
Run an SQL command on that server.