Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    4

    Angry Unanswered: DTS And VBScript

    I have an application written in C#, which allows the user to load their destination schema (in xml format) and writer their transformation expressions either in VBScript or in T-SQL. It uses DTS to do the ETL job.

    Everything works great except with one problem. If there is a hypen ("-") in any of the destination attributes, the transformation fails with syntax error. It happens only with VBScript.

    Here is my transformation:

    "Function Main()

    DTSDestination(\"Field-1\") = #01/01/2004#

    End Function"

    If I replace the hypen with underscore, it works without any problem.

    Does anyone have any idea about this problem?

  2. #2
    Join Date
    Apr 2004
    Location
    LA, CA
    Posts
    125
    Did you try to put the field name between brackets?
    [field-1]

  3. #3
    Join Date
    Aug 2003
    Posts
    4

    Angry

    Tried with \"[Field-1]\" and it did not do the magic

  4. #4
    Join Date
    Feb 2004
    Posts
    78
    Perhaps a hyphen is an invalid character for a field name. Use underscores and your problem is solved. You shouldn't be using '-'s in field names, anyway.

  5. #5
    Join Date
    Aug 2003
    Posts
    4

    Angry

    In general hypen ('-'s) are not allowed in a field. But if you enclose in [], it is a valid chr (atleast in SQLServer!).

    As my application is a B2B application and schema is maintained by an organization, I don't have any control. Hence I can not modify the field name.

    BTW, I tried the same this with Enterprise Manager, it works.

Posting Permissions

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