Results 1 to 3 of 3

Thread: DTS validation

  1. #1
    Join Date
    Oct 2003
    Location
    Argentina
    Posts
    11

    Unanswered: DTS validation

    Hello, I'm kind of new in database programming and I have to make a DTS where I put a CSV file with a list of names and emails and it has to validate the emails (but really validate them, not only the '@') and if the email is valid is inserted to a table and if it is invalid it goes to another table.
    Because I'm new I dont know were to start, first I need to know if there is a regular expression something on sql server because I have this expression that really validates a mail and doing it with SUBSTRINGs and CHARINDEXes would be really long (I think).

    regexp="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
    This works great with ASP but how do I put it in T-SQL syntax..

    Bye,
    Thanks in advance.

  2. #2
    Join Date
    May 2003
    Posts
    60

    Re: DTS validation

    You could use an ActiveX script in the DTS package. It supports both VBScript or Java Script.

    Or you could create an Extended Stored Procedure and use it in your DTS package.

    To create an extended stored procedure DLL by using Microsoft Visual C++

    1. Create a new project of type Win32 Dynamic Link Library.


    2. Set the directory for include files and library files to C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include and C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Lib, respectively.
    On the Tools menu, click Options.


    3. In the Options dialog box, click the Directories tab and set the directory for include files and library files.
    On the Project menu, click Settings.


    4. In the Project Settings dialog box, click the Link tab. Click the General category, and then add opends60.lib to object/library modules.


    5. Add source files (.c, .cpp, and .rc files, and so on) to your project.


    6. Compile and link your project.
    This comes from Books Online.

    Hope this helps some.




    Originally posted by ArgenSQL
    Hello, I'm kind of new in database programming and I have to make a DTS where I put a CSV file with a list of names and emails and it has to validate the emails (but really validate them, not only the '@') and if the email is valid is inserted to a table and if it is invalid it goes to another table.
    Because I'm new I dont know were to start, first I need to know if there is a regular expression something on sql server because I have this expression that really validates a mail and doing it with SUBSTRINGs and CHARINDEXes would be really long (I think).

    regexp="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
    This works great with ASP but how do I put it in T-SQL syntax..

    Bye,
    Thanks in advance.

  3. #3
    Join Date
    Oct 2003
    Location
    Argentina
    Posts
    11
    Thank you for your help, I solved it with an ActiveX script I just pasted the email validation function from my ASP code and it worked great, now I have another question, here is the link if someone cares, is about the first part of my question above.

    http://www.dbforums.com/showthread.php?threadid=949654

    Bye, Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •