473,378 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Create DTS package validation

Hi,

I have created a package that transfers transfers data from MS Excel file to the SQL Server 2000 database. I would like to add some data validation before the data is pumped into the database. How can I do that?

I would like to check the name of the file, column names (are there are spaces in column names), columns data types, the size of the file?

Thanks.
Jan 30 '07 #1
5 2322
iburyak
1,017 Expert 512MB
1. Load data into work table first.
2. Create stored procedure that does data validation and even can enter infected records with comments into error table or something like this.

Your creativity is a limit here.

After initial load into a work table just create another step that executes stored procedure that does actual insert into a production table.

Good luck.
Jan 30 '07 #2
The DTS package will be executed through the ASP application and I would like to validate the data before it enters the database. Could you show some code or example how to do it. So far I entered the validation to check if the file is there and file name by creating ActiveX script task on first connection (Excel 97-2000) in the package.

function main()
sFile = DTSGlobalVariables("gFileName").Value
Set oFSO = CreateObject("Scripting.FileSystemObject")

if oFSO.FileExists(sFile) then
Main = DTSTaskExecResult_Success
else
Main = DTSTaskExecResult_Failure
end if

end function

Can you help with column names and data types validation?
Jan 30 '07 #3
iburyak
1,017 Expert 512MB
Did you create a DTS package that transforms data?
Make destination table a work table (you should create work table on a server side) not an original production table.
Jan 30 '07 #4
No Use From You!

I will manipulate the data once in my work table to enter it properly to production table. But, some of the data is not transfered to my work table since some rows in Excel contain numbers and letters like 505X and the record is empty in my work table.

Can you give some code examples or not?
Jan 30 '07 #5
iburyak
1,017 Expert 512MB
I don't like what you said in your first sentence.
You should understand that I am not a salary paid adviser here. In some cases I don't know how to help you because I don't see what you do. If you said that you created a DTS package I assume you know how to do at least that.

My suggestion, in case where not all rows get to a table, is to create a work table with no datatypes just varchar columns. Make them big enough to fit all data.
After that you would be able to load all records and sort out the once that for example can't be converted into int.

To sort out alphanumeric values do following:

[PHP]Select * from work_table where column like ‘%[a-z,A-Z]%’

Or

Select * from work_table where column like ‘%[^0,1,2,3,4,5,6,7,8,9]%’[/PHP]
Jan 31 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Lonnie Princehouse | last post by:
In short: Is there any way to run Python WITHOUT trying to create .pyc files (or ..pyo) or to have Python not attempt to import the .pyc files it finds? Reason: We have a site-specific...
14
by: milkyway | last post by:
Hello, Is there a good validation package out there that can be used with javascript? I have tried the one here: http://www.peterbailey.net/fValidate/ but had some problems implementing it...
1
by: Vic Spainhower | last post by:
I have 2 drop-down menus (1) States (2) Shows By State. My question is how do I invoke a re-build of the Shows By State drop-down when the user requests a different state. I believe this has to be...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
2
by: Anantha | last post by:
Dear All, One day our Windows 2000 Server OS crashed, so our NT admin has re-installed the OS on C: drive. Fortunately we kept our database file and installation in F: drive. When we...
0
by: ShrimpBoy | last post by:
Hi! I'm trying to create a new SMS_Package with VB.NET... I have a SMS 2003 server 2.50.4160.2000 on a Win2K3 I got an error on the line with Package.Name = Name that is an "Unspecified...
1
by: CJM | last post by:
I'm working on my first Oracle DB, so bear with me... I have a couple of validation routines which are both returning the same result regardless of the inputs. One checks if a Serial No already...
1
by: elsheh | last post by:
I am trying to develop JavaServlet application using Apache Tomcat server. My application consists of two servlets and Java class for pooling connection. I need to include all my servlets in the same...
1
by: Anthony97 | last post by:
I'm trying to run a package in integration services and I'm getting the following errors: Error: An OLE DB error has occurred. Error Code: 0x80040E37 Error:"component "OLE DB Destination""...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.