Use SQL Server as Web Server? [closed] - sql-server

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Would it be possible to set up a SQL server as follows?
User enters a special URL in the browser
URL connects to a SQL server and calls a Stored Procedure (or Function)
Stored Procedure delivers HTML text as a result
No pictures are needed. Everything we need could be embedded in one single HTML.
EDIT:
The core idea of this question is to go without a separate web server. However, I don't want to re-create a full-blown web server with SQL server. My main idea is only that users could pull a HTML report directly from SQL server, without the need to take all the hassle and install a dedicated web server for this.
So technically, the core of my question is if there exists a special kind of URL which could call a stored procedure directly? Or if you can setup the SQL server in a way that it listens to some special URL calls?
EDIT 2:
Possibly, if SQL server could internally host a kind of "mini web server", that could also help.

Generally it is not possible without web server.
While you can output some html from stored procedure - SQL server itself lacks ability to listen for http requests and produce http responses.
In fact, dealing with http requests/responses is what web server intended to do - so there is no any reason for sql server to handle this.

In SQL Server 2005 something like this was possible through special web endpoints. This was horribly insecure and the feature was deprecated in the later versions of SQL Server.
For current versions of SQL Server you will need some web server and some sort of middleware (asp/asp.net/php/node.js) which will make the connection on behalf of the client. As an alternative you can use SSRS (reporting service) which uses IIS as a web server to run your site.

With SSRS:
User enters a special URL in the browser
Enters something like http://127.0.0.1/Reports/Pages/Report.aspx?ItemPath=%2fsome%2fname`
URL connects to a SQL server and calls a Stored Procedure (or Function)
Report connects to database and gets result.
Stored Procedure delivers HTML text as a result
Stored procedure returns plain result set. But you can generate report in MHTML format.

Related

Displaying data from Microsoft SQL Server with jetpack compose

I'm trying to display data from a remote SQL server in my application. The data im fetching is a URL for an image, that i will display with asynchronous image.
So far i've established a connection, can load the data and print it. Every time I try to display any of it in my UI my app crashes.
Can anyone point me in the right direction of what i need to research, and what this problem could be called? Then i can research it myself. I have established the connection with jdbc.
Can the data maybe be fetched with a network connection even when it is on a SQL database?
Im not really expecting code answers. i would just like to know which direction i could take to solve this.
I tried multiple things and have researched a lot, but everything seems to be with a network connection and with HTTp calls. could i also use this?
Otherwise it is RMOm and SQLite can i connect my remote database to this?
1、First, the App is the interface API for accessing the web server, and then the web server, such as springCloud or Java Servlet, connects to the database SQL Server through JDBC.
2、After the web server connects to the database through JDBC, it can query the data content in the database through SQL statements.
3、Generally, if a picture is stored in SQL Server, it is mapped to the disk address of the server, but if you want to store the picture in the database, it needs to be stored in blob format, and then the data format returned by the web server query must ensure that the App can read it.

Hiding data in Sql Server 2008 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
Our sql server userid and password is known to a third party who is using our data integrated with his application bypassing us. He also uses the windows authentication to login and gets all the data required from the client side. I need to hide a few columns from others in sql server. I am aware of the data encryption which is not feasible at this stage and there are too many reports to be modified.
Is there a way to open a database connection along with a symetric/asymetric key and then use the same regular sql statements to read the data?
How to block sql server from logging in using Windows authentication?
Try this: Instead of allowin access to a full table, create a view with only the "public" columns, and give thrid party only access to that view. That way they cannot see you sensitive data columns. Blocking SQL to access from windows autentication is easy, only remove the user from the database.

Definition of a server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Slightly random one which has been bugging me for a while.
I am confused as to what actually makes a server a sever. I understand that a web-sever like Apache 'serves' web pages to the client. Why then is an SQL database server also called as such. What behaviours do the two entities have in common that make both of them servers? Or is it simply a case of same word - different meaning.
Appreciate any light shedding
Thanks
Dear Why we used "server" keyword in general scenario.
Server means, it serve the service.
So this keyword is associate because both are given service.
Sqlserver :- it store the actual data and give response as data to application response, comes from application which is hosted on application server. In sqlserver we can get/set the from various way like direct query of select/insert/update, via stored procedure, via application , used for SSIS, SSRS, SSAS services too.
Apache web server :- It is Web server, means a location where your application is actually hosted. It is used "WEB" keyword means it is used for web technologies and web application is hosted on that.
Both are different in terms of service, but give service or response as request comes, that why we called server.
An apache web server "serves" web pages to the client. An SQL database server "serves" databases to client applications. Applications need databases to store and extract data from, and a server provides them with exactly that.

Running a process that interacts with SQL Server from a Windows Service - alternative to SQL Server agent jobs [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am looking for an alternative to SQL Server Agent jobs - there is a need to control running and scheduling of processes (executables, "jobs") and so I intend to implement a Windows Service that will act as a scheduler for these processes.
These processes are not interactive, so there is no problem starting them from a Windows Service, but they need to work with SQL Server - reading and writing data, executing stored procedures etc.
Commands to windows service ("scheduler") - like "enqueue a job" - would be passed from SQL Server CLR in UDF or directly from a client side web app via WCF (haven't decided yet).
Is this a right way to do this? Are there any access and security issues should I be aware of? I am particulary worried about possible limitations on processes run from a windows service.
Please share your experiences with similar designs.
Also, I consider using SQL Server Service Broker (suggested in similar thread) but I am not sure if it fits my needs.
Thank you!
Adam
The right way to achieve a reasonable security level is:
create a new user that will run the Windows Service (you can create this user in Control Panel)
create a new login for this user in SQL Server (using Integrated Security)
give the necessary, but minimum, permissions to this user in SQL Server
To implement a service you must be aware of a few things:
if you use WCF (or any other service stack), you need a thread for listening the requests and a different thread to run the processes in SQL server. If not, the subsequent requests will probably time out. (You can launch new threads for each task, or implement a queue to avoid overloading the server).
be extremely careful with error (exception) handling. If an unhandled exception is thrown your service will stop, until someone starts it again
it's harder to implement the UDF solution, becasuse you need to modify SQL Server security settings to allow an UDF to communicate with the "outer world"
you should include some kind of logging in your service, so that you can test it and verify it's working correctly.
It's not to hard to make an executable that can be run as console app as well as as a service. If you do so you can run it from the Visual Studio debugger, or stand alone, and log in the console (Console.Write...(...)), to see what's going on.

Drupal 7 webform submission to remote MSSQL server

When users fill up a form on my Drupal 7 site, I need that information to go into a remote MS SQL server db. It's essentially a reservation system, so they fill up details like date/time and name, and when they click submit, these fields need to be pushed into a remote MS SQL db.
I'd like to know a) if this is possible and b) how do I go about implementing this?
A. Yes it is possible.
B. I recommend the below way, which is also the "Drupal" way of doing it.
Establish a connection to the remote database. Have a look here if you want to do it in your code, or have a look here if you want Drupal to take care of it by configuring settings.php. The key to switching between databases are db_set_active($database).
Run the queries you'd like to run against the MSSQL database. Just remember to put switch between the databases using db_set_active().
You can create a custom form in Drupal easily using its Form API in a custom module. In the submit handler for your form, you can insert the submitted data to your MS SQL database using any library avaiable in your PHP environment. Connection to the database is the tricky part, especially if your Drupal host is not running a Microsoft OS. In Drupal 7 running on IIS, you can use Drupal's Database API with the MS SQL driver. If your are not on IIS or Drupal 7, this is also doable without Drupal's Database API using PDO ODBC with unixODBC and FreeTDS. I did it, but I had a major issue when using typed bound parameters in my query, see Using typed bound parameters with PHP PDO-ODBC, unixODBC and FreeTDS.
That said, integration of applications at the database level is a bad idea. Such integration is tightly coupled. Any change to the schema of your MS SQL database or they way actual data are stored in columns will break your form submission. The best would be to have your reservation system provides a remote API to insert new data.

Resources