Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Tuesday, March 27, 2012

DTS execution

I'm having trouble with dts. I used the dtswizard to create a dts package, yet when I use dtsrun with the package name, I get a message saying that the package cannot be found. I've even copied the .dtsx file into the same folder as dtsrun and still gotten the same message. Can someone shed some light on what I might be messing up. Btw, I'd love to run the dtsrunui, but apparently that file wasn't part of my distribution.where have u saved your package? inside sql server or as a disk file. it appears that it was saved as disk file. so u should mention the file path with /F switch during dtsrun call. to have it available under dtsrunui u should first select "Structured Storage File" and point to the location of the saved file if not saved inside sql server.|||I've tried saving the file or even copying the .dtsx file right to the root just to make the path simple, but then the process tells me it is not a dts package. How can the dtswizard create a file that isn't truly a dts package? In a related note, how can I "get my hands on" the dtsrunui executable. It's not on my system, nor is the dtsexecui. Either of these would make this process simpler for me I'm sure|||Greetings, Mark! For those of you following this thread, I'm coming into it with a fair bit of background from outside this thread... I didn't somehow magically divine the background from just what's posted.

I'm assuming that this is the SSIS package you built using the Transact-SQL that I provided, and that you are running this on the SQL 2005 Express machine... If any of those assumptions are bad, the rest of this message is worthless.

If I told you to use DTSRUN, that was my mistake... I should have specified DTSEXEC. See the web page on dtsrun to dtexec Command Option Mapping (http://msdn2.microsoft.com/en-us/library/ms345282.aspx) for more details on the conversion from DTSRUN to DTSEXEC.

Anywho, its good to see you here! Hopefully you'll get quicker answers here than waiting for me, but then again I do make "housecalls" for old friends when I'm in the neighborhood!

-PatPsql

Thursday, March 22, 2012

DTS Delimited Record Question

Hello-
I am using SQL Server 2000 and am processing records via DTS. The
records are delimited and I have no trouble breaking them using the
file object but every record ends with a tilde (~) that I would like to
strip off. Is it possible to set the record delimiter to "Tilde+cr+lf"
so that the tilde would get chopped off each record before being passed
to my AxtiveX script? The records do not have the same number of
elements, so I can not simply chmop the tilde off the Nth field.
If the above will not work, how can I determine the final field in each
record and remove the offending tilde?
Thanks!
--greg
Hi
If you do not expect a tilda in any field you can just replace any occurence
in every field. If you activeX scripts assumes that there are at most n
fields you can check backwards to the last non-blank field and remove the
tilda.
John
"tubaranger@.gmail.com" wrote:

> Hello-
> I am using SQL Server 2000 and am processing records via DTS. The
> records are delimited and I have no trouble breaking them using the
> file object but every record ends with a tilde (~) that I would like to
> strip off. Is it possible to set the record delimiter to "Tilde+cr+lf"
> so that the tilde would get chopped off each record before being passed
> to my AxtiveX script? The records do not have the same number of
> elements, so I can not simply chmop the tilde off the Nth field.
> If the above will not work, how can I determine the final field in each
> record and remove the offending tilde?
> Thanks!
> --greg
>
sql

DTS Delimited Record Question

Hello-
I am using SQL Server 2000 and am processing records via DTS. The
records are delimited and I have no trouble breaking them using the
file object but every record ends with a tilde (~) that I would like to
strip off. Is it possible to set the record delimiter to "Tilde+cr+lf"
so that the tilde would get chopped off each record before being passed
to my AxtiveX script? The records do not have the same number of
elements, so I can not simply chmop the tilde off the Nth field.
If the above will not work, how can I determine the final field in each
record and remove the offending tilde?
Thanks!
--gregHi
If you do not expect a tilda in any field you can just replace any occurence
in every field. If you activeX scripts assumes that there are at most n
fields you can check backwards to the last non-blank field and remove the
tilda.
John
"tubaranger@.gmail.com" wrote:

> Hello-
> I am using SQL Server 2000 and am processing records via DTS. The
> records are delimited and I have no trouble breaking them using the
> file object but every record ends with a tilde (~) that I would like to
> strip off. Is it possible to set the record delimiter to "Tilde+cr+lf"
> so that the tilde would get chopped off each record before being passed
> to my AxtiveX script? The records do not have the same number of
> elements, so I can not simply chmop the tilde off the Nth field.
> If the above will not work, how can I determine the final field in each
> record and remove the offending tilde?
> Thanks!
> --greg
>

DTS Delimited Record Question

Hello-
I am using SQL Server 2000 and am processing records via DTS. The
records are delimited and I have no trouble breaking them using the
file object but every record ends with a tilde (~) that I would like to
strip off. Is it possible to set the record delimiter to "Tilde+cr+lf"
so that the tilde would get chopped off each record before being passed
to my AxtiveX script? The records do not have the same number of
elements, so I can not simply chmop the tilde off the Nth field.
If the above will not work, how can I determine the final field in each
record and remove the offending tilde?
Thanks!
--gregHi
If you do not expect a tilda in any field you can just replace any occurence
in every field. If you activeX scripts assumes that there are at most n
fields you can check backwards to the last non-blank field and remove the
tilda.
John
"tubaranger@.gmail.com" wrote:
> Hello-
> I am using SQL Server 2000 and am processing records via DTS. The
> records are delimited and I have no trouble breaking them using the
> file object but every record ends with a tilde (~) that I would like to
> strip off. Is it possible to set the record delimiter to "Tilde+cr+lf"
> so that the tilde would get chopped off each record before being passed
> to my AxtiveX script? The records do not have the same number of
> elements, so I can not simply chmop the tilde off the Nth field.
> If the above will not work, how can I determine the final field in each
> record and remove the offending tilde?
> Thanks!
> --greg
>

Monday, March 19, 2012

DTS automatic dat file import

Hi y'all

I'm having some trouble with the following script I use in a
dts-package. I use it to automatically import a dat-file of which the
name changes every day. Today the name f.e. is P0000020.dat, tomorrow
it's P0000021.dat and the day after P0000022.dat etc etc The error I
get is end of instruction expected.
This is the script:

'************************************************* *********************
' Visual Basic ActiveX Script
'************************************************* ***********************

Function Main()
Dim oPkg, oDataPump
Dim sSourceTable, sDestinationTable

' Derive the new table names
sSourceTable ="" & GetName
sDestinationTable = sSourceTable
' Get reference to the DataPump Task
Set oPkg = DTSGlobalVariables.Parent
Set oDataPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask

' Set the new values
oDataPump.SourceObjectName = sSourceTable
oDataPump.DestinationObjectName = "[Test].[test].[tblXafaxOutput]"
' Clean Up
Set oDataPump = Nothing
Set oPkg = Nothing

Main = DTSTaskExecResult_Success
End Function

Function GetName
Dim number, counter, file
counter = 1
number = DTSGlobalVariables("NextNumber").Value
number = number + 1
For counter = 1 To 7 - Len(number)
file = file & "O"
Next teller
file = "P" & file & getal & ".dat"
DTSGlobalVariables("NextNumber").Value = number
GetName = file
End Function

I've used this script before in another dts-package where the
file-name needs to be based up-on the date and it worked just fine.
You can find the script at:
http://groups.google.be/groups?hl=n...l e.com#link10

I hope anyone can help me.
thanx in advance
Piedro

PS I've my english is crap it's because it ain't my mothertongue."Piedro" <pproost@.hotmail.com> wrote in message
news:b7e3650a.0309231319.7d8d0ffa@.posting.google.c om...
> Hi y'all
> I'm having some trouble with the following script I use in a
> dts-package. I use it to automatically import a dat-file of which the
> name changes every day. Today the name f.e. is P0000020.dat, tomorrow
> it's P0000021.dat and the day after P0000022.dat etc etc The error I
> get is end of instruction expected.
> This is the script:
> '************************************************* *********************
> ' Visual Basic ActiveX Script
> '************************************************* ***********************
> Function Main()
> Dim oPkg, oDataPump
> Dim sSourceTable, sDestinationTable
> ' Derive the new table names
> sSourceTable ="" & GetName
> sDestinationTable = sSourceTable
> ' Get reference to the DataPump Task
> Set oPkg = DTSGlobalVariables.Parent
> Set oDataPump = oPkg.Tasks("DTSTask_DTSDataPumpTask_1").CustomTask
> ' Set the new values
> oDataPump.SourceObjectName = sSourceTable
> oDataPump.DestinationObjectName = "[Test].[test].[tblXafaxOutput]"
> ' Clean Up
> Set oDataPump = Nothing
> Set oPkg = Nothing
> Main = DTSTaskExecResult_Success
> End Function
> Function GetName
> Dim number, counter, file
> counter = 1
> number = DTSGlobalVariables("NextNumber").Value
> number = number + 1
> For counter = 1 To 7 - Len(number)
> file = file & "O"
> Next teller
> file = "P" & file & getal & ".dat"
> DTSGlobalVariables("NextNumber").Value = number
> GetName = file
> End Function
>
> I've used this script before in another dts-package where the
> file-name needs to be based up-on the date and it worked just fine.
> You can find the script at:
http://groups.google.be/groups?hl=n...l e.com#link10
> I hope anyone can help me.
> thanx in advance
> Piedro
>
> PS I've my english is crap it's because it ain't my mothertongue.

The message you get is probably because of the For .. Next loop. In
VBScript, you can't put the counter variable name after Next (as you would
in VB):

For x = 1 To 10
' Do something
Next ' This is OK

For x = 1 To 10
' Do something
Next x ' This is wrong

Simon