I have SQL Server 2014 Express installed in a firm with my C# application. Every once in a while, when the app isn't used for some time, the SQL Server instance stops. And I have to go there, enter the services and manually start it. After that it works just fine.
How can I prevent this?
I have set the startup type for my SQL Server service to Automatic.
Should I maybe try to set it to Automatic(delayed start)?
The machine that the SQL Server is installed on is running Microsoft Server 2012.
And for now it is not connected to the internet, it's only in LAN.
So I guess the thing with the updates is not the problem, because the machine is not on the internet.
This is the exception that is thrown:
Looks like you're just dealing with default behavior for user instances. Databases will auto close and engine auto shuts down after x minutes. You can extend this by changing the configuration option "user instance timeout". Details can be found at User Instances for Non-Administrators Look for the administration section with detailed scripts for showing and changing the configuration option. You should also check out Lifetime of a User Instance Connection for more details.
This was originally intended to conserve resources that are typically scarce for SQL Express usage scenarios. Quite a bit has changed since the time this was designed. Also, with Developer edition download being free now, you should seriously evaluate your use of Express to see if Developer edition is the better solution for you. Even if it's purely for local use (within your machine) for dev/test purposes, if it will eventually be deployed to a SQL Server in production, you really should use Developer edition instead of Express. If you'll only even run in Express then go ahead and make the tweaks in the paragraph above.
Related
As the graph shows above. Which type of sql server edition is for the production? I know the "Developer" version is for the development. Also I already got the Azure VM and have the "Developer SQL Server" on my VM, how can I install the production SQL Server in my VM? Is this free?
My purpose is to make a production SQL Server database. Is there two options for me? One is install a production SQL Server in my VM, another is to create a new Azure SQL database. Which one would be the best way to do this?
As the graph shows above. Which type of sql server edition is for the
Production? I know the "Developer" version is for the development.
Also I already got the Azure VM and have the "Developer SQl server" on
my VM, how can I install the production sql server on my VM? Is this
free?
Developer is not licenced for production - you aren't allowed to use it for production purposes.
Express is licenced for production but if your database gets bigger that 10Gb then it is unsuitable for your use
My purpose is to make a production sql server database. Is there two
options for me? One is install a production sql server on my VM,
another is to create a new Azure SQL database. Which one would be the
best way to do this?
"Best" doesn't mean anything. What are your constraints? Are you creating a brand new database? What tools will be connecting to and using the database? Does it need to be accessible from the internet?
If this is a brand new application / database, and you have limited capability for maintaining a VM then I definitely recommend using SQL Azure instead of a VM
Most importantly, and based on you other question, make sure you understand the term "Production"
Can Azure SQL Server on VM be the production database?
For example, you usually don't provision a 'production' environment without also provisioning at least a dev environment.
It would also help to give us some background on "My purpose is to make a production sql server database". It sounds like this is a request someone has given you but maybe you don't fully understand the term 'production'
None of them are sql azure. They are all sql server on premise on a virtual machine on azure.
If you want to add a sql server azure, you go on your main azure portal page, then on the left panel at the top "create a resource", then chose "SQL Database" on the popular column. Then follow instructions.
If you want as less pain as possible, clearly choose sql azure instead of a sql server on premise on a virtual server on azure. It is by very far the only reasonable choice if you work on azure: cheap, strong, backup automatically done, disaster recovery extremely easily applicable without any prior setup, extremely easy to up size its capacity in case of overload, perfectly secured without any prior setup either.
The only problem of this is the security: it can be accessed only by recognized IP addresses that you mention on the azure portal. So typically, you mention the IP address of you development computer. If your website is on your azure subscription as well, you don't need to worry, it will go through the azure firewall with no setup.
If you reeeeeeally want to use a sql server on premise, well, don't use the developer edition. If you want to avoid performance and load issues, don't use express. The entreprise is very complete, but not useful in most of cases for simple application (like web applications).
If you want most of features, go for the Standard edition, if you want to keep focused on the database engine for your web application, go for the Web edition.
Finaly, if you wanna have a licence free edition on a virtual server, the express is free of charges, but not powerful and extremely limited. The developer edition is free of charges as well and contains every possible and impossible features of sql server. The only pb of this edition is that you are not allowed to use it in production. Only for tests and developments.
As you are already having Azure VM with Developer edition installed you can go for either of the below options.
If you are comfortable to manage the Azure VM yourself, go for IAAS(Infrastructure as a Service) approach: Install SQL Server Standard Edition or SQL Server Enterprise Edition (based on your application needs). Read the capability difference between them. If SQL Server Express edition would be suitable for your needs, then install the same. It does have limited features and many constraints. See the scalability support for different editions in the same link above.
If you want to offload the database server management, go for PAAS(Platform as a Service) approach: Create a Azure SQL database and point your application to it. Azure SQL database is more like SQL Server Enterprise Edition with some limitations like CLR not being supported. Read Azure SQL database differences with SQL Server editions
The title says it all: as we are nearing release of our desktop application, which uses a local database (SQLServer 2014 LocalDb), we want to password protect access to it.
The database will be created using EF Code First on the user's computer the first time he starts up the application.
This must be really simple, but I seem to overlook the solutions that should present itself on Google.
The short answer here is you can't password protect LocalDb. LocalDb is designed to be a low friction database setup for development and testing, but it does not provide any of the advanced features of SQL or even SQL Compact Edition. From MSDN:
LocalDB is created specifically for developers. It is very easy to install and requires no management
and then there is this:
Moreover, if the simplicity (and limitations) of LocalDB fit the needs of the target application environment, developers can continue using it in production, as LocalDB makes a pretty good embedded database too
"pretty good" implies that while it will work, there may be better solutions. Essentially, the lack of security is a feature of LocalDB. It is designed to run as the currently logged in user, giving them full access.
If you need Database Security as a feature of your deployed application, but do not want to deal with the complexities of a full SQL installation, you should consider SQL Compact Edition.
See this article How to: Deploy a SQL Server Compact 4.0 Database with an Application. Deployment will vary depending on the deployment methods used by the rest of your application.
Entity Framework is an abstraction layer which is not specifically tied to a specific database technology. It will work identically with LocalDb, SQL Compact, SQL Express, MySQL, postgresql, etc... usually with nothing more than than the correct database driver and the correct connection string supplied.
My application has a client that also uses a local SQL Server database. In the early stages, I want to use clickonce to propagate changes/updates to the app, but without the SQL Server definitions/tables/and in some cases data in the tables, the client will not work.
I will admit that I can't find much on how to use an SQL Server Project type in VS 2012... But that might not even be applicable.
If this is impossible, then am I forced to do some kind of whacky migration script dl'd via web service?
The ClickOnce works fine for the client, BTW, but obviously on any run on a client (other than my dev box, of course), it barfs...
I'm using EF6+, and on my dev box SQL Server 2012, but there is so little data on the client that I could use SQL Server Express, and make that a ClickOnce prerequisite... But again, how do you roll the DB into the update/install(er)?
I must be losing it, because there is precious little I can locate that addresses this seemingly common architecture for deployment...
We used to have Deployment Projects in VS...
I´m deploying my database to a SQL Server 2008 R2 Express instance that my software also installs. Everything works fine, but on certain target machines there are other instances of SQL Server 2008, 2005, 2000...I know that, theoretically, SQL Server instances may coexist side-by-side. But I also know that there are several conflicts between them. Internet is full of them.
My most common symptom is: server protocols are not installed with a previous installed SQL Server 2008 instance (from other vendor). In SQL Server Configuration Manager, under "SQL Server Network Configuration", the item "Protocols for 'MyInstance'" is just missing. So any client machine can connect to server.
I´d like to minimize the visits to clients house and make my application as self-deployable as possible. Is there something I can do to avoid or resolve instances conflicts? Any advice? Am I wishing for something impossible?
You probably will want to read up on what versions can live on the same server/client:
Working With Multiple Versions and Instances of SQL Server
Work with Multiple Versions and Instances of SQL Server
Both of these links have the chart regarding what side-by-side installs are supported, the second though also includes a little bit more regarding the components and those that will be upgraded to the highest release installed.
With the issue you spoke of with SSCM this can be caused by many things, most of them revolve around a corrupted installation of the management tools; or I mostly see issues with WMI calls on the client. Since most of those settings are available within the registry I would suggest looking at that side to get your instance configured and locked down.
You might also look at SQL Server Compact Edition. It is developed as an embeded database that does not require install of the full SQL Server managemnet tools. You have the same API and controlls that come with full version of SQL Server, just a "compact" install. I have interacted with one application that used it but have not done any development with it.
I want to know if it's possible to profile my web application when it's hitting a database on a SQL Server Express server with ANTS profiler.
Out of the box, I'm not able to. It's complaining about:
No event provider could be located for
the SQL server instance 'SQLEXPRESS'
Has anyone been able to get around this, or do I have to upgrade my sql server?
Red Gate have just open an Early Access Program (EAP) for ANTS Performance Profiler. One of the new features is the ability to profile any SQL or Oracle server type, including SQL Server Express.
The EAP page is here: http://help.red-gate.com/help/ANTSPerformanceProfiler/download_eap.html
The SQL/Oracle servers can also be remote - previously the database server had to be on the same machine as the application that was being profiled.
From #Remus Rusanu ANTS uses ETW for monitoring your application SQL calls. ETW events are not available in SQL Server Express Edition.
http://blogs.msdn.com/b/sqlqueryprocessing/archive/2006/11/12/using-etw-for-sql-server-2005.aspx
Where should I starts?... Lets just stick with the basics: ANTS is a manager profiles. SQL Server is a native application. So besides the other minor hurdles like lack of symbols, imposibility to instrument the binaries and not least breaking your EULA terms, the simple fact that you're trying to use managed code profiler on a native binary should be enough to convince you of the error of your ways.
Perhaps you are looking for the SQL Profiler application?