WK5 DQs
SYM REPLIES
A Trevor Stoutt
Hi Professor Perez and Class
When it comes to extracting data from a database and converting date/time fields into different formats that can be done by using such commands as (DT_DBTIMESTAMP2) or (DT_DBDATE). When it comes to the command of (DT_DBDATE) this command will bring back the date in this format of 2023-03-01 if not put in the correct order of today, but this is the right style that most computers and the world use today. Another command to get a date to return within a database is ((DT_DATE)”03/01/2023”) which will bring the date in the correct format of 03/01/2023 when executed. Then we have a format that brings back the time stamp down to the seconds by using this command of (DT_DBTIME2, 5) “16:34:52.12345”. Then you have the command that will bring back not only the date but also the time down to seconds. The command to bring this information up would be (DT_DBTIMESTAMP2, 4) “1999-10-11 16:34:52.1234”. All these commands and then some can bring every data and bring the data/time forward in these formats depending on which command we type or use for the database (Microsoft. 2023).
B Trevor Stoutt
To extract data from a database and convert the date/time format, the user must create a new SSIS project within the SSDT program. The first step once the project is opened is to attach a data flow task to the project. The user will then need to select the source database from which they are trying to acquire data. They will then have to hook the outputs from the source database to a data conversion tool and configure it to convert the data from the DT_DBTIMESTAMP2 data type to the DT_DBDATE data format. Lastly, the user will need to connect the data conversion to the source destination database, after configuring the table in the source database for the new data, and then run the package to extract all data and verify that it is correct.
C Joshua Victor
To extract data from a database and convert date/time fields out of the data into a different format (DT_DBTIMESTAMP2 to DT_DBDATE) using SSIS, a database administrator can follow the steps below:
· Create a new Integration Services project in Open Business Intelligence Development Studio.
· In the SSIS Designer, drag and drop a Data Flow Task onto the Control Flow tab.
· Double-click on the Data Flow Task to open the Data Flow tab.
· Drag and drop an OLE DB Source onto the Data Flow tab.
· Double-click on the OLE DB Source to open the OLE DB Source Editor and configure the database connection and SQL query to extract the required data. Ensure that the query includes the date/time fields that need to be converted.
· Drag and drop a Data Conversion transformation onto the Data Flow tab.
· Connect the output of the OLE DB Source to the input of the Data Conversion transformation.
· Double-click on the Data Conversion transformation to open the Data Conversion Editor.
· In the Data Conversion Editor, select the date/time fields that need to be converted and change their data type to DT_DBDATE.\
· Drag and drop an OLE DB Destination onto the Data Flow tab.
· Connect the output of the Data Conversion transformation to the input of the OLE DB Destination.
· Double-click on the OLE DB Destination to open the OLE DB Destination Editor and configure the database connection and table where the extracted data will be stored.
· Map the columns from the input to the destination table.
· Click OK to save the configurations and close the editors.\Run the SSIS package to extract the data and convert the date/time fields into the required format.