On premises linked server connection to Azure server SQL pool - linked-server

Using Serverless SQL endpoint, I can connect locally using SSMS to it (using Azure Active Directory - Integrated) so is creating a link server possible?

Related

GCloud - Connecting App Engine Flex to Cloud SQL in other project

I'm trying to connect my app engine flex service to the cloud sql database that is in a shared project.
I have added the app engine default and app engine flex user as SQL admin to the shared project.
Now I'm trying to connect the app engine container to the cloud sql instance with the following connection string:
"Server=cloudsql;Database=cliche;User Id=user;Password=password;"
However, the connection always fails with the given connection string.
[13:57:37 ERR] An error occurred using the connection to database 'cliche' on server 'cloudsql'.
[13:57:37 ERR] An exception occurred while iterating over the results of a query for context type 'IKL.Data.ApplicationDbContext'.
Microsoft.Data.SqlClient.SqlException (0x80131904): 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: TCP Provider, error: 40 - Could not open a connection to SQL Server)
As requested I provide the app.yaml here:
runtime: aspnetcore
env: flex
service: platform
manual_scaling:
instances: 1
resources:
cpu: 2
memory_gb: 1.5
disk_size_gb: 10
beta_settings:
cloud_sql_instances: shared-resources-291914:europe-west3:edutec-mssql=tcp:1433
I found your issue! Your connexion string "Server=cloudsql;Database=cliche;User Id=user;Password=password;" isn't correct.
Cloud SQL proxy open a tunnel. one side of the tunnel is the Cloud SQL instance, the other is your local instance. Therefore you have to connect on the local host
"Server=127.0.0.1;Database=cliche;User Id=user;Password=password;"
If you are using VPC Peering between your App Engine Flex project and your Cloud SQL project, then I must inform you that this is not possible to do yet, when you use an internal IP on your Cloud SQL, it will automatically use a VPC peering (different from the one you are probably using), and traffic between 3 VPC peerings is not posible.
You can use a VM in your Cloud SQL project to serve as a NAT server to route traffic onto your Cloud SQL there in order to workaround this, or you can use a Cloud VPN between your App Engine and Cloud SQL project, if possible please make sure that the NAT VM is in the same region as your Cloud SQL server or that the VPN on your SQL project is on the same region as your SQL server.
Also, please keep in mind that you would need to have the appropriate GCP firewall rules on all the involved GCP projects.

Synchronization of data from local database to live server using SQL Server

I have one server installed locally and other is company,s live server. I have an application installed on local machine, so whenever I run my application data on both SQL Server instances (local and live) should sync to keep same database on both servers how this can be done live database in cloud server with public ip and local databases are in my local system. I would be happy if anyone could provide sample format for this using asp.net C#
Why don't you use SQL Server Replication.

How to run job schedular in ms-sql in your remote desktop server if there is no sql server agent option

I Want to run job schedular on network service but while connection to that server i dont see the option of sql server agent.How to run job schedular in ms-sql in your remote desktop server if there is no sql server agent option in remote server.I am using asp.net and ms-sql.

What happens if there were some connection in the pool and database server switches

I have a small query about what will happen to the application pool active connection if the database server switches.
I am using asp.net 4.o hosted on IIS 7.5 and oracle server running on linux.
Using ado.net to connect oracle server.

Connection to SQL server 2000 on a windows server 2003 domain controller

I am trying to connect an ASP.NET 2.0 application hosted on a client machine to an SQL server 2000 instance which is installed on a domain controller running windows server 2003 (I appreciate this is not best practise, but it is something I cannot change). I am using SQL server authentication, not Windows authentication.
During debugging, the following error is displayed at the point the 'connection' is attempted within the web application (not on running any object within Sql Server):
"An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I have done some research, and have checked a variety of things:
1) I am certain the conection string is correct - in fact I built a little Windows app that uses the same connection information and connection succeeds...
2) This is limited to the web application - a windows application running on the remote client machine connects just fine using the same connection string (see 1).
3) The firewall settings on both computers do not prevent the connection (see 1).
4) I can ping the windows 2003 server (see 1)
5) The SQL Server credentials definitely have the rights to the objects needed
6) If I (temporarily) put the web application on the windows server 2003 and run it, it loads and runs fine (using a browser on a separate machine, or on the client machine I am trying to connect) - suggesting this is only an issue with a remote connection, and confirming the connectivity between the machines again, and also confirming the necessary security right of the SQL Server user.
7) I can start query analyser on the client machine and using the same SQL server credentials, can run the same queries on the target database just fine.
Stumped. Please help!
You need to go into the SQL Server Configuration Manager and make sure the Named Pipes option is turned on. It is not turned on by default when you install SQL Server.
Because of the research I did in the original question covering the ability of a windows app to connect but not the ASP.NET app to connect from the same machine, and the confirmation the web app was working on the server itself, I was convinced SQL server was set up correctly, that connectivity and firewalls were not a problem - it must have been a difference in the security credentials of the windows app versus the web app.
The windows app runs in the security credentials of the logged on windows user and authenticates using that, whereas the webapp runs in a restricted account and does not pass these credentials over when connecting to SQL server by default. I simply added to web.config, which impersonates the user account within which the web app runs, and it all worked!
Problem solved.

Resources