I have finished my first complete Orchard CMS website, developed locally in SQL Server CE. I want to publish it to Azure, but I am having difficulty with the WebMatrix Migrate function.
I have a SQL Server instance in Azure with an blank Orchard database already there (I want to use the replace option late in the migration to just nuke the existing db). I have added my IP to the server firewall rule.
In WebMatrix 3 I can connect to my Azure database using:
Server: myserver.database.windows.net
Database: orchard-db
Username: admin#myserver
Password: mypassword
I can view the tables in WebMatrix.
When I select my CE sdf file (Orchard.sdf) and click the Migrate button and enter the exact same details I get the following (can provide full stack trace if needed):
We were unable to connect using the connection details provided.
Microsoft.SqlServer.Management.Common.ConnectionFailureException:
Failed to connect to server . ---> System.Data.SqlClient.SqlException:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: Named
Pipes Provider, error: 40 - Could not open a connection to SQL Server)
---> System.ComponentModel.Win32Exception: The network path was not found
I'm really not sure what the issue is. I have tried various configurations of the details but nothing seems to work. If I connect as my database user (i.e. not a server admin) I get a different error:
The server principal "orchard_user" is not able to access the database "master" under the current security context.
I went and had something to eat, and now I can get to the next step of the migration. When I select replace database I get the following error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server . ---> System.Data.SqlClient.SqlException: Login failed for user 'admin'.
EDIT: I have come to the conclusion WebMatrix is not going to migrate my SQL Server CE database to my Azure SQL Server database. I installed SQL Server Express and migrated it to that, when I get home from work I will use the SQL Server Migration Assistant to move it to Azure.
I ended up installing SQL Server Express, using WebMatrix to migrate the SQL Server CE database to that. I then ran the Deploy Database to Microsoft Azure Database Wizard in SSMS to push my database to Azure.
I can't be certain, but it seems that WebMatrix can't migrate CE to Azure. According to Azure doco:
It is recommended that you always use the latest version of Management Studio to remain synchronized with updates to Microsoft Azure and SQL Database. Update SQL Server Management Studio.
I guess WebMatrix is behind or something. Hopefully this helps someone in my situation.
Related
I am trying to create a connection manager in Microsoft SQL Server Data Tools for Visual Studio 2017 (SSDT) for an integration services project.
In the Connection Manager:
The Provider is set to: Native OLE DB\SQL Server Naive Client 11.0
The Server name is set to: the name of the local machine
Log on to the server is set to: Windows Authentication
Connect to a database is set to: Select or enter a database name. However no database names appear in the drop down box - the drop down box is blank. I am expecting the name of the database i am working on, including the master database etc to be present.
When I Test Connection, I get an error message which says:
'Test connection failed because of an error in initializing provider. Login timeout expired
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
Named Pipes Provider: Could not open a connection to SQL Server [2]..'
I am using SQL Server 2017 and Microsoft SQL Server Management Studio 18.
Allow remote connections has been ticked in SSMS.
The only thing i can see is the SQL Server Agent and SQL Server Browser has stopped / is not running and the TCP/IP Protocols for SQLEXPRESS is set to disabled - I am unable to enable it without a further Access is denied (0x80070005) error.
I have tried to follow all of the guides but cannot progress. Could somebody please offer some further guidance?
I have resolved the issue. It was an extremely silly oversight! On installation, the server name in the Visual Studio 17 Connection Manager was listed as: Local MachineName only. In SQL Server, the Server Name was listed as: LocalMachineName\SQLEXPRESS. The Server Name in VS17 has to be exactly the same as SQL Server. As i said, this is a very silly oversight on my part but have documented for future reference.
SQL Server Configuration Manager ==> SQL Server Services(Left sidebar) ==> Right Click and Start all Stopped services
My objective is to use the migration tool in SQL Developer to migrate 2 SQL Server databases to Oracle. I am attempting to connect to a SQL Server database at a remote location using Oracle SQL Developer 4.0.
I have installed jtds.1.3.0.jar per instructions, and get the SQL Server and Sybase tabs in the connection properties window.
I have entered the user, pw, hostname, port, and database name. When I try to Retrieve Database, or connect, I get the error message:
Status : Failure -Test failed: I/O Error: DB server closed connection.
The SQL Server DBA tells me her error logs contain the following error message:
Encryption is required to connect to this server but the client library does not support encryption; the connection has been closed. Please upgrade your client library. [CLIENT: (my computer's IP address)] Error: 17835, Severity: 20, State: 1.
When I look at SQL Server documentation about this error message, it talks about certificates and SQL Server Connection Manager. Some relevant information to show that I've covered the basics:
Using the same connection parameters, I am able to connect to the SQL Server database using Toad for SQL Server.
Using the same connection parameters, a DBA set up an Oracle Transparent Gateway, and I can connect to the SQL Server database using the gateway and a database link. (As far as I know, neither of these methods required a certificate to connect.)
Both of these use ODBC; SQL Developer uses jdbc with TCP/IP.
The DBA assures me TCP/IP connection is turned on for the SQL Server databases.
I have gone into the XML file where SQL Developer stores the connection string. It has the form jdbc:jtds:sqlserver://sql-xxx-xxx.mw.nos.xxx.com:1433/my_db, which looks correct. I have tweaked it by adding the instance name, but no difference. The database has a default instance name, anyway, so it shouldn't be necessary.
A co-worker has been able to connect to a local SQL Server database on the same machine where SQL Developer was running (both on his laptop).
As a workaround, I am also pursuing the possibility of installing SQL Server on a local workstation, and copying the databases there for processing, but I don't know if I can get approval. If you know another tool for migrating from SQL Server to Oracle, please also let me know.
Thanks in advance.
I'm new to ETL so I have developed a simple ETL package, and now I'm going to deploy it to a remote server.
I connect to server using SQL Server authentication, so I go to solution explorer and open deployment wizard, in there in destination tab entered my server ip and then it shows me a error message saying
Login failed for user 'MYDOMAIN\MYUSERNAME'. (.Net SqlClient Data Provider)
As I said earlier I want to use SQL Server authentication to connect to my server, where can I change this settings in SSIS ?
Take a look at the link below. I think it should solve your problem.
On the Specify Target SQL Server page, specify the instance of SQL Server to install the packages to and select an authentication mode. If you select SQL Server Authentication, you must provide a user name and a password.
https://technet.microsoft.com/en-us/library/ms141693(v=sql.110).aspx
I installed SQL Server 2008 (not express) on my PC, but when tried to connect with SSMS, got this message:
A network-related or instance specific error occured while established
a connection to SQL Server. The server was not found or was not
accessible. Verify that the instance name is correct and that SQL
Server is configured to allow remote connections.(provider: Named
Pipes Provider, error: 40- Could not open a connection to SQL Server)
(Misrosoft SQL Server, Error 2)
My connection dialog box to SSMS is:
Server type: Database Engine.
Server name: (local)
Authentication: Windows
What should I check? Where to start troubleshooting?
GO TO >> Run Command (Ctrl + r )
Type -- services.msc
go to SQL SERVER >> Right Click >> Click Start
Again Restart SQL SERVER Studio
Here are some troubleshooting tips that you can do:
Try to run your SSMS as admin
Make sure that you are using the correct server name and instance
Check if your sql server service is running by going to run -> services.msc -> Check SQL Server(Instance Name) service if it is running
Error 40 has many reasons, some of them are related to network configurations which are out of scope in your question. Other reasons which may cause this error and has possibility in your question are as follow:
Make sure that SQL SERVER(XXX) service is running by visiting sql server configuration manager section
Make sure that SQL Browser service is running by visiting sql server configuration manager section
Make sure you are using the correct instance name
Read more about this error
If your server is Local. Try to login with server name . or (local).
If you are still not able to login, check Check SQL Server Configuration Manager (Start>All Programs>MS SQL Server>Configuration Tools>Configuration Manager)
I have checked the instance name, auto close is set to true, allow remote connections on the server is checked. The server is running when I open the SQL Server configuration manager. I have even rebooted. I have created this db the same way as all others. I use Entity Framework and have checked the names in the web.config and they match. This is the default connection string from the wizard - I use for testing before I deploy. I just can't think of anything else to check to figure out why it won't connect. Working inside SQL Server everything is fine.
Here is the general error.
A network-related or instance-specific error occurred while establishing a connection to SQL >Server. The server was not found or was not accessible. Verify that the instance name is >correct and that SQL Server is configured to allow remote connections. (provider: Shared >Memory Provider, error: 40 - Could not open a connection to SQL Server)
Config:
connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string='data source=.\SQL_1;attachdbfilename="C:\Program Files (x86)\Microsoft SQL Server\MSSQL10_50.SQL_1\MSSQL\DATA\A_db.mdf";integrated security=True;connect timeout=10;user instance=True;multipleactiveresultsets=True;App=EntityFramework'" providerName="System.Data.EntityClient" />
Thanks in advance.
Let me preface this answer by saying that proper setup of a SQL instance is not as easy as Microsoft would like you to think with the entity framework. It's a little bit involved and requires that you put your DBA hat on for a little bit.
The error you have indicates that the web instance is attempting to connect to the SQL server using Windows Integrated Security. This will work fine if (a) the windows user that the process is running as (which can be configured in IIS) is authorized to log on to the SQL server and has a valid login in the database and (b) if the SQL server is on the same machine or in the same domain as the IIS server.
In light of this, I recommend using SQL Server authentication. If you need to know how to do this, I recommend searching for "SQL Server Authentication setup" - here is an article that I found which might help you set this up.
http://msdn.microsoft.com/en-us/library/aa337562.aspx
In general, I recommend taking the following actions:
Connect to the sql server using MS SQL Management Studio.
Permanently attach your database, then use the Initial Catalog property on your connection string rather than AttachDbFileName
Then set up your login username and password on the SQL server, and create a login in the database for it.
Make sure your login can only execute the stored procedures you want it to execute. Deny it access to running sql statements.
You will also need to add the username and password to your connection string, and set IntegratedSecurity=false.
Let us know how things go once you get your SQL server set up properly.
This error means that your provider code cannot find the SQL Server. If you have checked the server instance name (it should be <yourLocalServer>\SQL_1), then it could be the attachdbfilename= parameter, as this is a really unreliable way to specify the database to connect to (you should be using the Database Name, not the file name), because there are about a hundred reasons that the file name could change that have nothing to do with your application.