Overwrite files in a DTS using ActiveX
Several of my DTS jobs require processing a file and then archiving the file. As we all know, you can use ActiveX to Copy or Move a file. Problem is, sometimes we need to reprocess or reuse a file name. When the archive ActiveX step executes, the step will fail if the file already exists...
Using ActiveX to set query dynamically in SQL Server
Learn how to use ActiveX to dynamically change a query.
Using ActiveX to check the age of a file in SQL Server
Now, you can use ActiveX to check the age of a file before proceeding. The code assumes that you have already assigned the file location elsewhere in the DTS Package
Using ActiveX to Dynamically set a Variable in an SQL Server DTS Package
From time to time, you will need to dynamically set a variable in the middle of your DTS packages. The following code shows you how easy it is to build a variable dynamically. The variable will be filename which contains the current timestamp. Here is the code: '************************* ' Sets the file name to the...
Change a Date Format Using ActiveX and SQL DTS Transformations
Let’s say you are importing data from a flat file to SQL Server via DTS. Now, let’s say the date format in the source file is similar to this: YYYYMMDD. If your destination column is a datetime or smalldatetime, SQL server isn’t going to know what to do with this data, at least not initially....
Adding Foreign Keys after a table is created in SQL Server
Well, you knew exactly what you needed when you created a table. Only now when you created a child table, the child table does not update with the information from your main table. Or worse you deleted something from your primary table and it still lives in the child table. You need a foreign key,...
Adding Checks after a table is created in SQL Server
Did you create a table, only to find that you need to add a check constraint? I created a quick example of how to add a check constraint after the table exists. In this example, we want to know if our user is alive or dead. 1 = alive, 0 = dead. Here is the...




