0

I am trying to write a bash or PHP script that will execute a procedure on a MS-SQL Server. Does anybody have pointers on how to do that in the easiest and most convenient way?

The script will run on a separate Linux box.

3 Answers 3

1

Installing the php mssql drivers (on Linux) can become a real pain. Just take that in mind.

We had to deal with a hosting company, which refused to install them. I ended up with a wcf service (installed as a windows service) on the sql server machine, which just invokes the sp and a simple http request from the php script. I think it is quite cool actually.

I realize that a lot of people would qualify that as an absolute overkill, but there is no doubt that an http request can be performed from a lot of devices and platforms. You don't have to install the sql drivers on every machine and platform you need to execute the sp.

That way you don't have to 'open' the sql server for remote connections, but you host wcf service (which is not more secure or anything... just a difference, some people get crazy when hear about allowing sql remote connections)

Sign up to request clarification or add additional context in comments.

1 Comment

Actually, in my case, installin anything on the Linux machine is easy and under my control, anything related to the MS SQL machine is not :P
0

you can use mssql class for PHP.

Comments

0

Here is an example of how to execute a sproc in PHP.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.