SQL Stored Procedures |
[eluser]Nathan Pitman (Nine Four)[/eluser]
So I'm a bit of a novice when it comes to Stored Procedures and MS SQL Server. In the past I've always used MySQL and although I understand what stored procedures are (in essence) I have no idea how to call one from CI, or event plain vanilla PHP for that matter. Any pointers much appreciated!!! ![]()
[eluser]Jay Turley[/eluser]
It is my understanding that it would be similar to this: Code: $sql = "EXECUTE StoredProcedureName @parameter1= ?, @parameter2= ?"; I am very experienced with MS SQL Server, but am new to both CI and PHP, so please, correct me if I am wrong.
[eluser]James V[/eluser]
I know there are select situations where stored procedures are useful, but I can't think of any where they'd be of use to me. Can anyone enlighten me? A friend was raving about them the other day, and I've done some research since, but I just don't get it.
[eluser]GSV Sleeper Service[/eluser]
@ James V - stored procedures are 'compiled' and preloaded into memory for faster execution of queries.
[eluser]Jay Turley[/eluser]
[quote author="James V" date="1205993649"]I know there are select situations where stored procedures are useful, but I can't think of any where they'd be of use to me. Can anyone enlighten me? A friend was raving about them the other day, and I've done some research since, but I just don't get it.[/quote] In addition, when using classic ASP against MS SQL Server, it allows you to have some additional value checking, similar to how CI checks the values in the parameterized statement above.
[eluser]esra[/eluser]
[quote author="James V" date="1205993649"]I know there are select situations where stored procedures are useful, but I can't think of any where they'd be of use to me. Can anyone enlighten me? A friend was raving about them the other day, and I've done some research since, but I just don't get it.[/quote] http://dev.mysql.com/doc/refman/5.0/en/s...dures.html
[eluser]matthewr[/eluser]
MSSQL really sucks. I'm forced to use this at work (my day job) and man, there are so much limitations and errors!
[eluser]Jay Turley[/eluser]
[quote author="matthewr" date="1206395854"]MSSQL really sucks. I'm forced to use this at work (my day job) and man, there are so much limitations and errors![/quote] Really? I've been working with it for several years now, and I find that it is actually very simple to use, because it is a MS product. Therefore as long as you use it the way they intended you have no problems. If you have specific issues, feel free to PM me; I may be able to help you out.
[eluser]senojeel[/eluser]
Just curious...What version of MSSQL server are you connecting to? 2000 or 2005?
[eluser]Nathan Pitman (Nine Four)[/eluser]
[quote author="Jay Turley" date="1205965187"]It is my understanding that it would be similar to this: Code: $sql = "EXECUTE StoredProcedureName @parameter1= ?, @parameter2= ?"; I am very experienced with MS SQL Server, but am new to both CI and PHP, so please, correct me if I am wrong.[/quote] Hi Jay, out of interest then what db driver should I use for MS SQL Server? ODBC? |
Welcome Guest, Not a member yet? Register Sign In |