In the midst of changing around some tables and views in my database I had a dream. A dream that involved me not having to open up my code generator and creating new data objects. A dream that didn't include generating SPROCs that I would have to copy and paste into my Query Analyser to run. It further didn't include setting up permissions to each of those newly entered SPROCs. While every one of these steps is generated for me, I still have to go in and manually DO things.
I don't want to do things. My first though was to create a program that I could just click a button and all these steps would run. The Bill Pierce said that MyGeneration could run from the command line. I looked it up and sure enough, a Command line interface is provided via ZuesCmd.Exe. Now how to call it?
I found out that you can call out batch files through the command line using xp_cmdshell. Sounds pretty good so far.
Now I just need a trigger that will fire when a table is updated. So far I've only found that when you create a new table, the "sysobjects" table registers that new table with the table name 'name' and that it's new with a 'U' in the 'xtype' column. The idea being, that the trigger would fire the xp_cmdshell, which would in turn call MyGeneration which would create the Data Objects and SPROC SQL. After MyGeneration finished, SQL Server would then call the generated SQL script to create the SPROCs and give permissions to each accordingly. Now to just find how to get a trigger going to monitor column changes and updates and I think I will try to put something together. So far this is just an idea.
What I think the cool thing would be, is if I could get this going, I'm sure other developers out there would like to use it too. I'm sure that other Data frameworks could be similarly generated so it should work with those as well.