SQL Server machine account failed to open database - sql-server

I have an ASP.NET Web application hosted in IIS. Application is running under LocalSystem account. Application is trying to connect to a database on SQL Server with Integrated Security=True. I have added the machine account to sql server and also made it sysadmin. I have provided access to the specified database. Still I am getting error: Failed to open the explicitly specified database.
Please help.

Related

Cannot deploy metadata to Analysis Services

Building a tabular model in Visual Studio I'm facing an issue when trying to deploy the model to the Analysis Service Server (SQL Server 2019 Standard). I get this error:
Cannot deploy metadata. Reason: An error occurred while connecting to the server.
I already set the deployment server in the model properties. And the last thing I tried was to set the Administrator local user of the SQL Server in the Impersonation Information dialog, but is giving me the invalid user / password error.
Also tried to use Service Account, but having the same error.
I can get the data from the SQL Server (using SQL Server Authentication) but the problem is when trying to deploy the model to the Analysis Server.
Is this error caused because the servers are not part of an AD?
Any way to work around this, or way to see any logs?
Using Visual Studio 2017 and 2019.
Thanks.
Is this error caused because the servers are not part of an AD?
Possibly. SSAS only supports Windows Integrated Auth, so you need to make that work. The preferred method is to deploy from a session owned by a SSAS administrator, from a workstation in the same domain.
If that's not possible there are a couple of other options. One is to create a local account on both the workstation and the server with the same name and password, and log in as that account to deploy.
The other is to install a Windows Credential in the windows credential store for an identity that has rights to deploy to the SSAS database. Or to run visual studio via runas /netonly specifying the credentials for the remote server.

An attempt to login using SQL authentication failed. Server is configured for windows authentication

One of our SQL servers is configured to use both Windows and SQL Authentication, however, we are seeing the continues error "An attempt to login using SQL authentication failed. Server is configured for Windows authentication" in the log. From SQL Management studio we are able to access the server using the same user credentials using SQL Authentication but when one of the applications is using the same user credentials to connect to the SQL server then we are getting the same error.
You may need to restart the SQL Engine Service for the change to be applied. Whoever changed the authentication may not have restarted the service.

Attempt to migrate SQL Server database to Azure fails with login failed

In SSMS, I'm trying to use the "Deploy Database to SQL Azure Database" utility.
I'm moving a small local database in SQL Server 2012 to Azure for hosting. But after entering the host database server connection parameters I always get a "Login Failed for user,...." error, referencing the name of the local database to be created on the server.
Why this would fail is unclear, since the database does not exist on the cloud server yet. Here is what I have done:
Set up a firewall exception for my local IP address.
Confirmed my server administrator user name and password
So now I am left guessing... Locally I use Windows Authentication. If a database is to be moved to the server, does it have to have SQL Server authentication, as is required on Azure host?
You need to have the SQL server Authentication enabled in order to be able to login to your database when you move it to Azure.
Once, you login through SQL server authentication, you can create your users then and have different logins for different users.
Hope this helps!

Connection To The Database Failed on install dotnetnuke

I try to install dotnetnuke 7. I created an user that access to dnn database and in properties of sql server set the server authentication to sqlserver and windows authentication .But when browse website show this message :Connection To The Database Failed
Try connecting to the database using SQL Server Management Studio using the same credentials that you specify in DNN. That might help you identify what you are doing wrong.
You'll want to verify that the SQL Server accepts connections from the web server, assuming that they are not on the same machine.

Problem with ASP.NET Membership API connecting to sql express

While installing SQL Server 2005, I unknowingly uninstalled the existing SQL Express(I dont know 2005/2008) , but then I installed sql express 2005. But now the membership api is not able to connect to the sql express database. When I run my application with the Visual Studio 2008 , and try to login into my application I am getting the following error ,
"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory. The provider attempted to automatically create the application services database because the provider determined that the database does not exist. The following configuration requirements are necessary to successfully check for existence of the application services database and automatically create the application services database:
If the applications App_Data directory does not already exist, the web server account must have read and write access to the applications directory. This is necessary because the web server account will automatically create the App_Data directory if it does not already exist.
If the applications App_Data directory already exists, the web server account only requires read and write access to the applications App_Data directory. This is necessary because the web server account will attempt to verify that the Sql Server Express database already exists within the applications App_Data directory. Revoking read access on the App_Data directory from the web server account will prevent the provider from correctly determining if the Sql Server Express database already exists. This will cause an error when the provider attempts to create a duplicate of an already existing database. Write access is required because the web server accounts credentials are used when creating the new database.
Sql Server Express must be installed on the machine.
The process identity for the web server account must have a local user profile. See the readme document for details on how to create a local user profile for both machine and domain accounts.
Actually I am using ASP.NET MVC, and by default it has the membership functionality in the web application template, and that too is not working.
you need to change the settings of the sql server express service - refer here
Try deleting the SQLExpress directory which should be at C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS directory.
Then restart your machine.

Resources