Run Microsoft .SQL within CI Model - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Run Microsoft .SQL within CI Model (/showthread.php?tid=39843) |
Run Microsoft .SQL within CI Model - El Forum - 03-22-2011 [eluser]Ben Bowler[/eluser] I have a tricky little question for you here. I have a collection of MS SQL files like the following which were used with ToadSQL to retrieve data in the past. Code: -- RUN AS SCRIPT SO THAT MONDAY IS FIRST DAY OF THE WEEK I'm now building an application in CodeIgniter to automate the process but I don't want to reinvent the wheel with the queries. Is there anyway within a CI Model I can retrieve the responses of these complex queries by running the .sql file? It's made particularly complex by the fact that some query two tables and use 'union' is this possible? Hope there are some SQL heads out there who can help. Ben Run Microsoft .SQL within CI Model - El Forum - 03-23-2011 [eluser]Ben Bowler[/eluser] If anyone's interested I slept on it and came up with this ridiculously simple function: Code: /** |