In one of my recent articles, I wrote about the import of dictionary data from Excel spreadsheets. At that time, I listed 3 stages of performing such a task:
• Establishing the structure of the dictionary table in the database.
• Registration of the dictionary in Metastudio.
• Importing data from the spreadsheet, where the data had been maintained until now.
Recently, I was faced with the need to prepare a demo repository for a presentation for one of our clients, and having a small amount of time to prepare, I was looking for various solutions that would help me in the faster realization of this task. To the “rescue” came Zbyszek Finfando, who has been actively taking advantage of the benefits that various incarnations of artificial intelligence offer to the average user. Thanks to his suggestion, I decided to use ChatGPT to accomplish the first of the aforementioned tasks.
It turned out that ChatGPT handles the preparation of DLL procedures that create dictionary table structures in a specific database environment very well.
All you have to do is prepare a query in which we will specify the database environment in which we want to create a table, and provide its basic properties, i.e.:
• Table name
• Column names and types
• Additional properties such as an auto-incrementing primary key
My question was:
ChatGPT immediately prepared an answer for me:
If we need additional columns that will store audit information? No problem: we receive a modified script that creates a table with such columns:
Perhaps we could modify the table further so that it stores values in a Type 2 Slowly Changing Dimension (SCD) arrangement:
Life has never been so easy! Maybe a bit more refinement so that column names comply with the ANSI standard (just ask):
In the same way, I treated the remaining tables, defining all my needs at once. Preparing a dozen or so structures in this way took me significantly less time than if I had to create them “manually”!
What’s more, we can approach this type of task from another perspective. Instead of manually defining the types of individual columns, we can pass a fragment of the dictionary along with the data and ask for the preparation of a DDL script based on it. This is not the most desirable “model of cooperation” with AI – we need to have some sample values prepared, as we do not want to share “real” data, but in some cases, this may be an acceptable solution:
In the same way, I treated the remaining tables, defining all my needs at once. After a few seconds, we have a ready solution:
I realize that we cannot always afford to use a tool like ChatGPT, after all, all the information we enter into the conversation window lands on a remote server abroad. However, this does not change the fact that the tool works really well. Moreover, during our “conversation”, we deepen the context and the subsequent AI responses are increasingly tailored to our expectations. When executing a complete task, e.g., migrating dictionary data from Excel spreadsheets to Metastudio DRM, in the absence of previously established database structures, using the support of available AI tools, in my subjective assessment, is much easier and faster to implement than with a traditional approach. As long as we have no doubts about the confidentiality of the information conveyed in the conversation with artificial intelligence – I recommend this type of approach.