Is it possible to access database object using HTTP in SQL Server 2012 the way it was done using SQL Server 2000?
I referred following article but it is about SQL Server 2000.
Accessing Database Objects Using HTTP
I want to access the database object in following manner
http://iisserver(my machine ip)/nwind/dbobject/Test4[#Id='1']/#x
As shown in the article http://technet.microsoft.com/en-us/library/cc646023.aspx#BKMK_ssde, the SQL server can be configured to be accessed via HTTP. To achieve this you firstly need to create and endpoint (as described here). Among this, the firewall issue is also need to be checked because of the additional ports usage. But, according to this article, the HTTP endpoints will not be supported in the future versions of SQL Server.
Related
We are soon to migrate our back-end from an Amazon SQL Server RDS to another identically set up RDS server. We intend that our systems will not be interrupted because they connect using an AWS alias that we will swap to point to the new RDS server.
While we believe all our systems use the alias and not direct server addressing, it is possible that we have missed the change in some application code.
Can anyone advise a method we can use to identify applications that are connecting without the alias?
Is there anything to indicate the connection method from with SQL Server Profiler?
Is it possible to log what applications use the alias from AWS?
I'm trying to use AWS QuickSight to analyse some data that is being stored in SQL Server on an Azure SQL server.
According to QuickSight, it can connect to an SQL Server, but whenever I try to validate the connection, the process hangs for about a minute then comes back with 'Cannot open server "..." requested by the login. The login failed.'
I initially suspected that this was an issue with the firewall on the MS SQL server on Azure. Accordingly, I looked up the IP regions here
The region I am using is US West (Oregon) (us-west-2), so I white-listed the IP range 54.70.204.128 to 54.70.204.159 - but I am still getting exactly the same 1 minute (or so) pause, before the error comes back in Quick Sight.
The exact error is:
Your database generated a SQL exception. This can be caused by query timeouts, resource constraints, unexpected DDL alterations before or during a query, and other database errors. Check your database settings and your query, and try again.
If I click "Show Details" then I get a further message saying:
Error details
region: us-west-2
timestamp: XXX
requestId: XXX
sourceErrorCode:40532
sourceErrorMessage: Cannot open server "..." requested by the login. The login failed. ClientConnectionId:*
sourceErrorState: S0001
sourceException: com.microsoft.sqlserver.jdbc.SQLServerException
sourceType: SQLSERVER
Obviously some of the above has been redacted.
I cannot believe that QuickSight cannot connect to an Azure MS SQL database, so I'm wondering if anyone else had had this problem, and what their solution was?
I myself had this issue and it seems many others did. However, as noted above, there is little to no documentation that provides the steps to connect Quicksight and Azure Sql Server.
The issues for myself were primarily in the details that I gave Quicksight. Most connections with Azure sql server database connect seamlessly with your basic information:
Server, Port, Database Name, Username, Password
However, AWS Quicksight was trying to connect to my Azure Sql server with JDBC authentification.
JDBC Authentification requires your Username input to be = "username"#"servername"
Example of Correct Connection:
Server: "servername".database.windows.net
Port: 1433
Database Name: "databasename"
Username: "username"#"servername"
Password: "password"
Lastly, I turned off the SSL checkbox. It did not work with SSL connection.
Please see this document: Relational Data Sources
You can use any of the following relational data stores as data sources for Amazon QuickSight:
Amazon Athena
Amazon Aurora
Amazon Redshift
Amazon Redshift Spectrum
Amazon S3
Amazon S3 Analytics
Apache Spark 2.0 or later
MariaDB 10.0 or later
Microsoft SQL Server 2012 or later
MySQL 5.1 or later
PostgreSQL 9.3.1 or later
Presto 0.167 or later
Snowflake
Teradata 14.0 or later
Note
You can access additional data sources not listed here by linking or importing them through supported data sources.
You can retrieve data from tables and materialized views in PostgreSQL instances, and from tables in all other database instances.
Amazon Redshift clusters, Amazon Athena databases, and Amazon Relational Database Service (RDS) instances must be in AWS. Other database instances must be in one of the following environments to be accessible from Amazon QuickSight:
Amazon EC2
On your local network
In a data center or some other internet-accessible environment
AWS QuickSight document doesn't say it support Azure SQL database, just said the supproted other database environments.
And others have asked this problems in AWS Discussion Forums, no one or AWS QuickSight official given the answer.
Reference: Can Quicksight connect to Azure SQL Database?
What we can guess that it doesn't support Azure SQL for now.
Hope this helps.
According to any Googling I have done, and the responses posted here, it appears that while there is no specific statement from AWS or Azure saying the two cannot be connected, equally there is no response to say that they can. Interestingly, nobody has responded to say that they have already got it working. My feeling at the moment is that it cannot work.
While Azure SQL is not explicitly listed as one of the QuickSight data sources, you can still use it as a data source. TLS/SSL is also supported now and I have tested it personally.
You just need to make sure to use the "username"#"servername" format for the Username, as mentioned by Scotty Smith.
I wanted to read AWS Postgresql from within SQL Server, so
I created a system ODBC connection to Postgresql on the SQL Server machine, tested it, fine.
I then created a Linked Server to connect to postgresql.
In the Security tab (For a login not defined in the list above, connections will), I selected "Be made using the login's current security context".
When using this linked server while connected to SQL Server through windows authentication, it works fine.
If I connect to SQL Server using a SQL Server authenticated account, trying to access postgresql data through that same Linked Server fails authentication.
I fixed that by switching my security setting to "Be made using this security context" and giving the POSTGRESQL login/password (same that I gave at the ODBC level).
Question:
Without repeating the postgresql details at the Linked Server stage, why is it working with Window sauthentication account and not for SQL Server authenticated accounts?
Neither are relevant to Postgresql?...
I made it work but still confused...
I will have to guess a bit to help you, but I hope to give you enough context to understand what is happening so you can debug further.
When you connect to SQL Server using integrated authentication, the domain controller gives out a token to talk to SQL and this is used to authenticate your connection from your client to SQL Server's process. Underneath the covers, Windows can use either NTLM or Kerberos to do this handshake. You can read more about this here in this blog post:
NTLM vs. Kerberos Blog. This protocol choice matters when trying to use linked servers since it has to then authenticate to something else over the network.
At this point, it matters what credentials are used to run SQL Server (usually as a service in the services window to see). If you are running SQL as Local System or Network Service or something else defined by windows (instead of as a specific user on the network), it may or may not have permissions to talk out to your target remote server (whether it be postgres or something else). When you use Kerberos and enable delegation (which the domain admin needs to do), you can have the original integrated auth credentials "flow" over the linked server link to the next connection. NTLM does not do this. Therefore, the usual scenario is to create a map in the local SQL Server of what credentials to use when talking out to a remote linked server.
If you are talking to an ODBC driver, then you are likely using the msdasql (OLEDB to ODBC bridge) provider and then also having to go through its authentication stack. It has been too long for my memory as to whether it even supports integrated auth at all, much less delegation in Kerberos. However, you may be able to debug this problem further if you:
consider which account is running SQL
consider which mechanism is used to do integrated auth to sql and whether that would work with delegation
determine which credentials are used to make the outbound connection to your ODBC target. You should be able to debug much of this through the profiler mechanism as there is a distributed query/linked server set of events IIRC.
I can't speak to your postgres provider specifically, but this should give you some more tools to debug. Hope that helps you get one step further.
If I did not want to create SqlConnection and SqlCommand objects etc etc but instead wanted to use only System.Net.WebClient (or some other "essentially plain text" communication) to talk to a SQL Server 2005 or above database, how would I go about connecting, issuing commands and receiving result sets?
I'm assuming I'll need to do a lot of parsing of data to get the structure I'm used to, but how would you go about a "bare-bones" SQL connection?
I recommend you go over Creating an OData API for StackOverflow including XML and JSON in 30 minutes to get a feel of how to add an OData layer to your application.
SqlClient (ie. SqlConnection and SqlCommand) is the bare-bones SQL connection objects. They're the lowest API that offers access to the TDS connections and there is nothing lower than that. Anything bellow this level would mean you'd have to write your own TDS implementation.
There is an alternative way of communicating with SQL Server, namely via HTTP SOAP services, see Overview of Native XML Web Services for Microsoft SQL Server 2005. However, this is
a deprecated feature and it doesn't give you any advantage.
If you want your client to communicate via plain HTTP with a SQL Server, you should place a web service layer to act as a communication mid-tier. Your client would talk to this layer using SOAP or REST, and this layer would talk to SQL in turn using TDS. Luckly there is a way to achieve this with just a few lines of code and a couple of clicks, by deploying an OData service.
Is it possible to use SQL Dependency with SQL Server Express 2005 which comes with VS 2008?
Yes. It works fine with named instances as well as default instances, on any SKU (Express, Web, Developer, Standard, Enterprise and Data Center). You can read The Mysterious Notification to understand the underlying mechanism that powers SQL Dependency.
When you open a database using the connection string option AttachDBName you are using a User Instance (aka RANU). The user instances attaches the MDF file using and by default a newly attached database will disable Service Broker in the database. Because the Query Notifications use Service Broker to deliver the notification, it implies that a database with Service Broker disabled cannot create a notification subscription, unless it takes the necessary steps to re-enable Service Broker.
This article suggest that it will work fine as long as the express edition database is a named instance:
http://www.code-magazine.com/article.aspx?quickid=0605061&page=5
HTH