Showing posts with label step. Show all posts
Showing posts with label step. Show all posts

Monday, March 26, 2012

ftp command help

I need to schedule copying of files to an ftp share using a SQL agent
job..but i dont know how to do that in one step
Say for eg: the source of files are on \\computerA\share1\*.*
and the destination is an ftp site ftp.x.com with a username and password
And i want to run this job on say computerB.
Then what would be the command ?
ThanksYou can either
1) create a DTS package (FTP task) then schedule the job by using
'dtsrun' command in the job.
2) use native ftp cmds in the job (jobs steps in an order). e.g.
ftp ftp.x.com
cd (to the location)
put <file>
dir (check if the file there)
close (close the connection)
bye
Mel

Ftp

Can somebody give me a complete picture about FTP task by VB or SQL SERVER 2000?I need to know every step.I have to do FTP task accross teo,three countries.Originally posted by subhasishray
Can somebody give me a complete picture about FTP task by VB or SQL SERVER 2000?I need to know every step.I have to do FTP task accross teo,three countries.

if u want to send or recieve file using FTP in a DTS package or using ActiveX script look at the attached files|||Originally posted by vmlal
if u want to send or recieve file using FTP in a DTS package or using ActiveX script look at the attached files|||if the FTP does not complete, network issue lets say? will the procedure end up as a failure or as a success?|||Originally posted by rohitkumar
if the FTP does not complete, network issue lets say? will the procedure end up as a failure or as a success?

Success i think but the downloaded file will be incomplete and there is no way to find that out. Unless you know the exact size of the file u r downloading and once it has been downloaed u check if the file downloaded is the correct size.

I have had this kinda problem where the FTP file transfer does not complete but the FTP session times - out.sql

Friday, March 23, 2012

Frustrating Visual Studio crashes when adding Script step

I have two similar packages that are both experiencing this issue.

I need to add a script step to generate an incrementing id for the packages.

Once I add the script step, and then save the package, next time I open the package I get a "Microsoft Visual Studio has encountered a problem and needs to close" error which kills off Visual Studio.

The error signature is:

EventType: clr20r3

P1: devenv.exe

P2: 8.0.50727.762

P3: 45716759

P4: microsoft.sqlserver.txscript

P5: 9.0.242.0

P6: 443f5ab8

P7: 67

P8: d

P9: bbp0yyyc15o2dbouwcacz2m0bodqkotn

If I move the error window to one side, delete the whole Script step, and save the Package, then I can reopen the package again without the error occurring.

Here is the actual code in my script step (in case its of any assistance...)

(I have retyped it from a printout, so it may not be 100%. DOCID is supposed to increment from 1. DREF1 is a system-unique id, that takes up from where the last batch left off, and is a string prefixed by "MP")

Code Snippet

Imports System

Imports System.Data

Imports System.math

Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

Imports Microsoft.SqlServer.Dta.Runtime.Wrapper

Public Class ScriptMain

Inherits UserComponent

Dim ndx as Int32 = 0

Public Overrides Sub Input0_ProcessInputRow(Byval Row as Input0Buffer)

'

' Add your code here

'

Dim dref as String

ndx = ndx + 1

Row.DOCID = ndx

dref = "MP" + Ctype(ndx + Variables.MPIDOrig, String)

Row.DREF1 = dref

End Sub

Protected Overrides Sub finalize()

Variables.MPID = ndx + Variables.MPIDOrig

MyBase.Finalize()

End Sub

End Class

I have found that when I take out the finalize() function, Visual Studio no longer crashes.

Can anyone suggest a different way to achieve what I am trying to achieve?

|||

Could you to put it into PostExecute()?

Thanks,

Bob

|||

Thanks, yes this was the answer.

It was a bit frustrating, as a relative newbie to SSIS, to find that the Finalize method caused this sort of behaviour, and it wasn't immediately obvious that PostExecute should be used instead.

(By which I mean I actually had to read deeper than jsut fiddling about in the IDE.)

Frustrating Visual Studio crashes when adding Script step

I have two similar packages that are both experiencing this issue.

I need to add a script step to generate an incrementing id for the packages.

Once I add the script step, and then save the package, next time I open the package I get a "Microsoft Visual Studio has encountered a problem and needs to close" error which kills off Visual Studio.

The error signature is:

EventType: clr20r3

P1: devenv.exe

P2: 8.0.50727.762

P3: 45716759

P4: microsoft.sqlserver.txscript

P5: 9.0.242.0

P6: 443f5ab8

P7: 67

P8: d

P9: bbp0yyyc15o2dbouwcacz2m0bodqkotn

If I move the error window to one side, delete the whole Script step, and save the Package, then I can reopen the package again without the error occurring.

Here is the actual code in my script step (in case its of any assistance...)

(I have retyped it from a printout, so it may not be 100%. DOCID is supposed to increment from 1. DREF1 is a system-unique id, that takes up from where the last batch left off, and is a string prefixed by "MP")

Code Snippet

Imports System

Imports System.Data

Imports System.math

Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

Imports Microsoft.SqlServer.Dta.Runtime.Wrapper

Public Class ScriptMain

Inherits UserComponent

Dim ndx as Int32 = 0

Public Overrides Sub Input0_ProcessInputRow(Byval Row as Input0Buffer)

'

' Add your code here

'

Dim dref as String

ndx = ndx + 1

Row.DOCID = ndx

dref = "MP" + Ctype(ndx + Variables.MPIDOrig, String)

Row.DREF1 = dref

End Sub

Protected Overrides Sub finalize()

Variables.MPID = ndx + Variables.MPIDOrig

MyBase.Finalize()

End Sub

End Class

I have found that when I take out the finalize() function, Visual Studio no longer crashes.

Can anyone suggest a different way to achieve what I am trying to achieve?

|||

Could you to put it into PostExecute()?

Thanks,

Bob

|||

Thanks, yes this was the answer.

It was a bit frustrating, as a relative newbie to SSIS, to find that the Finalize method caused this sort of behaviour, and it wasn't immediately obvious that PostExecute should be used instead.

(By which I mean I actually had to read deeper than jsut fiddling about in the IDE.)

sql

Frustrating Visual Studio crashes when adding Script step

I have two similar packages that are both experiencing this issue.

I need to add a script step to generate an incrementing id for the packages.

Once I add the script step, and then save the package, next time I open the package I get a "Microsoft Visual Studio has encountered a problem and needs to close" error which kills off Visual Studio.

The error signature is:

EventType: clr20r3

P1: devenv.exe

P2: 8.0.50727.762

P3: 45716759

P4: microsoft.sqlserver.txscript

P5: 9.0.242.0

P6: 443f5ab8

P7: 67

P8: d

P9: bbp0yyyc15o2dbouwcacz2m0bodqkotn

If I move the error window to one side, delete the whole Script step, and save the Package, then I can reopen the package again without the error occurring.

Here is the actual code in my script step (in case its of any assistance...)

(I have retyped it from a printout, so it may not be 100%. DOCID is supposed to increment from 1. DREF1 is a system-unique id, that takes up from where the last batch left off, and is a string prefixed by "MP")

Code Snippet

Imports System

Imports System.Data

Imports System.math

Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper

Imports Microsoft.SqlServer.Dta.Runtime.Wrapper

Public Class ScriptMain

Inherits UserComponent

Dim ndx as Int32 = 0

Public Overrides Sub Input0_ProcessInputRow(Byval Row as Input0Buffer)

'

' Add your code here

'

Dim dref as String

ndx = ndx + 1

Row.DOCID = ndx

dref = "MP" + Ctype(ndx + Variables.MPIDOrig, String)

Row.DREF1 = dref

End Sub

Protected Overrides Sub finalize()

Variables.MPID = ndx + Variables.MPIDOrig

MyBase.Finalize()

End Sub

End Class

I have found that when I take out the finalize() function, Visual Studio no longer crashes.

Can anyone suggest a different way to achieve what I am trying to achieve?

|||

Could you to put it into PostExecute()?

Thanks,

Bob

|||

Thanks, yes this was the answer.

It was a bit frustrating, as a relative newbie to SSIS, to find that the Finalize method caused this sort of behaviour, and it wasn't immediately obvious that PostExecute should be used instead.

(By which I mean I actually had to read deeper than jsut fiddling about in the IDE.)