tags:

views:

39

answers:

2

Hey all,

Working in a team environment, each one of us has put together our own list of SQL statements that we use to help with our day to day job functions. As the case often is, there may be some redundancy with this, and we are often in need of each other's statements. To circumvent this, I'm looking to put together a small app that can be used to store and search for these SQL statements.

To begin with, I'm keeping it basic, just storing and searching the statements. This may build out to be the actual execution at some point in the future, but I'm not concerning myself with this at the time.

This will be built with PHP and MySQL - Should I store the SQL as text, or is there something that I need to be concerned with?

A: 

text should be fine. you will also want a name (label) and possibly a descriptive field to let people know what it does in plain english.

Randy
A: 

Any particular reason these aren't just stored in the database as stored procedures?

Or in your version control system as scripts?

Cade Roux
I think he wants them to be searchable. As in, "What SQL snippets do we have that use the Wickets table?"
egrunin
@egrunin FWIW, I have stored procs in SQL which search, and in SQL Server, I use extended properties and schemas to organize them. It would be a pretty poor source control system which didn't allow organization and searching.
Cade Roux
The biggest reason is that we're not the dev team. On occasion we do need to look into the DB, maybe alter a few things, but it's not our primary function.I'm just thinking of putting together something basic for us, instead of everyone having their own .txt or .sql file with the queries each uses.
Tim F