When migrating between Courion environments I often run into situations where I need to not only migrate the structure of a table, but also the data. This is most common when migrating configuration tables. I looked for some SQL that would generate insert statements from a given table, and came across this blog entry.
This solution was not perfect, as it didn’t properly handle columns with spaces or that used reserved words in their names. Luckily someone else had fixed this and placed the solution in the comments. There is still one drawback that it handles empty columns as NULLs, but it still handles 90% of the work. If I have the time, I’ll try to work that out and post an updated solution.
SQL Code and usage after the jump.
Recent Comments