Showing posts with label task. Show all posts
Showing posts with label task. Show all posts

Wednesday, March 28, 2012

Problems with SQL Task

Hi!

I have a problem running a package and one of its SQL Tasks.

This is the action the task performs:

DELETE FROM Fac_Vendita WHERE Data >= ?

I pick the value from a variable I get from a previous task, and I map it in the new task like this:

Variable name: User::dur Direction: Input Data Type : DBTIMESTAMP Parameter Name: 0

I get this error:

DELETE FROM Fac_Vendita
WHERE Data >= ?" failed with the following error: "Invalid character value for cast specification". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

I tried also the other data type, but I get another type of error.... What's the problem?

Try setting the whole thing with a property expression instead - that should help to eliminate these problems.

-Jamie

|||How can I do it?|||

no more help is needed... I found another way to do it

Thanks anyway...

|||i am having the same problem, it would help if you could post your solution.

thanks,

nicolas|||i totally changed the approach, and I built a different statement.... My new SQL states:
DELETE FROM Name_Table WHERE (select .....)
this way it works..... :P

Tuesday, March 20, 2012

Problems with Maintenance Plans and File Deletes

Hi,
I'm hoping that someone can help me out. I am trying to add a
maintenance task to delete files older than say 2 days. When I create
the plan the tast runs but no files are deleted. If I view the TSQL
script created it reads:
EXECUTE master.dbo.xp_delete_file
0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
part of the problem.
Searching for info on msdn and books online yields no info on
xp_delete_file. Searching the MS support forums, google groups etc I
can find lots of messages where users are asking for assistance on how
to use this or why it doesn't work yet no one has an answer.
Considering the amount of money we just laid down for this product I am
absolutely astounded how little testing has gone into this maintenance
plans area.
Any MVPs have any ideas, or any one else found a work around on this.
Anyone know anyone on the Development team who can shed some light on
what this, why it doesn't work out of the box, and what can be done to
fix it?
StewI would like to find out more information on this as well. I will try to dig
a little deeper (again) and see if I can get someone to document this
feature. I will let you know if I find anything. IN the meantime try
running this manually in the query editor and see if it works as expected:
EXECUTE master.dbo.xp_delete_file
0,N'G:\sql_back_full',N'bak',N'20051218 16:25:00'
--
Andrew J. Kelly SQL MVP
<windsurfing_stew@.yahoo.com.au> wrote in message
news:1135056599.840877.305720@.g14g2000cwa.googlegroups.com...
> Hi,
> I'm hoping that someone can help me out. I am trying to add a
> maintenance task to delete files older than say 2 days. When I create
> the plan the tast runs but no files are deleted. If I view the TSQL
> script created it reads:
> EXECUTE master.dbo.xp_delete_file
> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
> part of the problem.
> Searching for info on msdn and books online yields no info on
> xp_delete_file. Searching the MS support forums, google groups etc I
> can find lots of messages where users are asking for assistance on how
> to use this or why it doesn't work yet no one has an answer.
> Considering the amount of money we just laid down for this product I am
> absolutely astounded how little testing has gone into this maintenance
> plans area.
> Any MVPs have any ideas, or any one else found a work around on this.
> Anyone know anyone on the Development team who can shed some light on
> what this, why it doesn't work out of the box, and what can be done to
> fix it?
> Stew
>|||Hi Andrew,
Thanks for your suggestion. I have tried this and unfortunately it
wasn't successful.
If you could 'dig a little deeper' to help on this one I'd be
particularly appreciative.
Looking forward to your response.
Stewart|||Any movement on this. Same problem. This is ridiculous.
"windsurfing_stew@.yahoo.com.au" wrote:
> Hi,
> I'm hoping that someone can help me out. I am trying to add a
> maintenance task to delete files older than say 2 days. When I create
> the plan the tast runs but no files are deleted. If I view the TSQL
> script created it reads:
> EXECUTE master.dbo.xp_delete_file
> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
> part of the problem.
> Searching for info on msdn and books online yields no info on
> xp_delete_file. Searching the MS support forums, google groups etc I
> can find lots of messages where users are asking for assistance on how
> to use this or why it doesn't work yet no one has an answer.
> Considering the amount of money we just laid down for this product I am
> absolutely astounded how little testing has gone into this maintenance
> plans area.
> Any MVPs have any ideas, or any one else found a work around on this.
> Anyone know anyone on the Development team who can shed some light on
> what this, why it doesn't work out of the box, and what can be done to
> fix it?
> Stew
>|||Nothing yet. Unfortunately the timing was wrong due to the holidays. I
think a lot of the SQL Dev team members took a long awaited vacation over
Christmas & New Years. I will ping them again.
--
Andrew J. Kelly SQL MVP
"Scott" <Scott@.discussions.microsoft.com> wrote in message
news:C86196B0-95AF-4EE2-B654-A2266D7FBE22@.microsoft.com...
> Any movement on this. Same problem. This is ridiculous.
> "windsurfing_stew@.yahoo.com.au" wrote:
>> Hi,
>> I'm hoping that someone can help me out. I am trying to add a
>> maintenance task to delete files older than say 2 days. When I create
>> the plan the tast runs but no files are deleted. If I view the TSQL
>> script created it reads:
>> EXECUTE master.dbo.xp_delete_file
>> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
>> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
>> part of the problem.
>> Searching for info on msdn and books online yields no info on
>> xp_delete_file. Searching the MS support forums, google groups etc I
>> can find lots of messages where users are asking for assistance on how
>> to use this or why it doesn't work yet no one has an answer.
>> Considering the amount of money we just laid down for this product I am
>> absolutely astounded how little testing has gone into this maintenance
>> plans area.
>> Any MVPs have any ideas, or any one else found a work around on this.
>> Anyone know anyone on the Development team who can shed some light on
>> what this, why it doesn't work out of the box, and what can be done to
>> fix it?
>> Stew
>>|||As far as I can tell, the new "cleanup" task can remove old files in a
single directory, but will not recurse. It took me a while to figure out I
had to specify a file extension and NOT include the leading "." in order to
get it to delete old .trn files. I now have all backups in a single folder,
instead of creating a new folder for each database. I also have two cleanup
tasks created to get rid of old .bak and another for .trn files. It's
functional now, but not evident when setting up.
This is a kludge. I would much rather have separate directories for old
backup files. The cleanup tool needs an option to recurse through
subdirectories when deleting files.
I agree that the backup options are a step backwards for SQL 2005.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23OBaViJEGHA.532@.TK2MSFTNGP15.phx.gbl...
> Nothing yet. Unfortunately the timing was wrong due to the holidays. I
> think a lot of the SQL Dev team members took a long awaited vacation over
> Christmas & New Years. I will ping them again.
> --
> Andrew J. Kelly SQL MVP
>
> "Scott" <Scott@.discussions.microsoft.com> wrote in message
> news:C86196B0-95AF-4EE2-B654-A2266D7FBE22@.microsoft.com...
>> Any movement on this. Same problem. This is ridiculous.
>> "windsurfing_stew@.yahoo.com.au" wrote:
>> Hi,
>> I'm hoping that someone can help me out. I am trying to add a
>> maintenance task to delete files older than say 2 days. When I create
>> the plan the tast runs but no files are deleted. If I view the TSQL
>> script created it reads:
>> EXECUTE master.dbo.xp_delete_file
>> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
>> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
>> part of the problem.
>> Searching for info on msdn and books online yields no info on
>> xp_delete_file. Searching the MS support forums, google groups etc I
>> can find lots of messages where users are asking for assistance on how
>> to use this or why it doesn't work yet no one has an answer.
>> Considering the amount of money we just laid down for this product I am
>> absolutely astounded how little testing has gone into this maintenance
>> plans area.
>> Any MVPs have any ideas, or any one else found a work around on this.
>> Anyone know anyone on the Development team who can shed some light on
>> what this, why it doesn't work out of the box, and what can be done to
>> fix it?
>> Stew
>>
>

Problems with Maintenance Plans and File Deletes

Hi,
I'm hoping that someone can help me out. I am trying to add a
maintenance task to delete files older than say 2 days. When I create
the plan the tast runs but no files are deleted. If I view the TSQL
script created it reads:
EXECUTE master.dbo.xp_delete_file
0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
part of the problem.
Searching for info on msdn and books online yields no info on
xp_delete_file. Searching the MS support forums, google groups etc I
can find lots of messages where users are asking for assistance on how
to use this or why it doesn't work yet no one has an answer.
Considering the amount of money we just laid down for this product I am
absolutely astounded how little testing has gone into this maintenance
plans area.
Any MVPs have any ideas, or any one else found a work around on this.
Anyone know anyone on the Development team who can shed some light on
what this, why it doesn't work out of the box, and what can be done to
fix it?
StewI would like to find out more information on this as well. I will try to dig
a little deeper (again) and see if I can get someone to document this
feature. I will let you know if I find anything. IN the meantime try
running this manually in the query editor and see if it works as expected:
EXECUTE master.dbo.xp_delete_file
0,N'G:\sql_back_full',N'bak',N'20051218 16:25:00'
Andrew J. Kelly SQL MVP
<windsurfing_stew@.yahoo.com.au> wrote in message
news:1135056599.840877.305720@.g14g2000cwa.googlegroups.com...
> Hi,
> I'm hoping that someone can help me out. I am trying to add a
> maintenance task to delete files older than say 2 days. When I create
> the plan the tast runs but no files are deleted. If I view the TSQL
> script created it reads:
> EXECUTE master.dbo.xp_delete_file
> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
> part of the problem.
> Searching for info on msdn and books online yields no info on
> xp_delete_file. Searching the MS support forums, google groups etc I
> can find lots of messages where users are asking for assistance on how
> to use this or why it doesn't work yet no one has an answer.
> Considering the amount of money we just laid down for this product I am
> absolutely astounded how little testing has gone into this maintenance
> plans area.
> Any MVPs have any ideas, or any one else found a work around on this.
> Anyone know anyone on the Development team who can shed some light on
> what this, why it doesn't work out of the box, and what can be done to
> fix it?
> Stew
>|||Hi Andrew,
Thanks for your suggestion. I have tried this and unfortunately it
wasn't successful.
If you could 'dig a little deeper' to help on this one I'd be
particularly appreciative.
Looking forward to your response.
Stewart|||Any movement on this. Same problem. This is ridiculous.
"windsurfing_stew@.yahoo.com.au" wrote:

> Hi,
> I'm hoping that someone can help me out. I am trying to add a
> maintenance task to delete files older than say 2 days. When I create
> the plan the tast runs but no files are deleted. If I view the TSQL
> script created it reads:
> EXECUTE master.dbo.xp_delete_file
> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
> part of the problem.
> Searching for info on msdn and books online yields no info on
> xp_delete_file. Searching the MS support forums, google groups etc I
> can find lots of messages where users are asking for assistance on how
> to use this or why it doesn't work yet no one has an answer.
> Considering the amount of money we just laid down for this product I am
> absolutely astounded how little testing has gone into this maintenance
> plans area.
> Any MVPs have any ideas, or any one else found a work around on this.
> Anyone know anyone on the Development team who can shed some light on
> what this, why it doesn't work out of the box, and what can be done to
> fix it?
> Stew
>|||Nothing yet. Unfortunately the timing was wrong due to the holidays. I
think a lot of the SQL Dev team members took a long awaited vacation over
Christmas & New Years. I will ping them again.
Andrew J. Kelly SQL MVP
"Scott" <Scott@.discussions.microsoft.com> wrote in message
news:C86196B0-95AF-4EE2-B654-A2266D7FBE22@.microsoft.com...[vbcol=seagreen]
> Any movement on this. Same problem. This is ridiculous.
> "windsurfing_stew@.yahoo.com.au" wrote:
>|||As far as I can tell, the new "cleanup" task can remove old files in a
single directory, but will not recurse. It took me a while to figure out I
had to specify a file extension and NOT include the leading "." in order to
get it to delete old .trn files. I now have all backups in a single folder,
instead of creating a new folder for each database. I also have two cleanup
tasks created to get rid of old .bak and another for .trn files. It's
functional now, but not evident when setting up.
This is a kludge. I would much rather have separate directories for old
backup files. The cleanup tool needs an option to recurse through
subdirectories when deleting files.
I agree that the backup options are a step backwards for SQL 2005.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23OBaViJEGHA.532@.TK2MSFTNGP15.phx.gbl...
> Nothing yet. Unfortunately the timing was wrong due to the holidays. I
> think a lot of the SQL Dev team members took a long awaited vacation over
> Christmas & New Years. I will ping them again.
> --
> Andrew J. Kelly SQL MVP
>
> "Scott" <Scott@.discussions.microsoft.com> wrote in message
> news:C86196B0-95AF-4EE2-B654-A2266D7FBE22@.microsoft.com...
>

Problems with Maintenance Plans and File Deletes

Hi,
I'm hoping that someone can help me out. I am trying to add a
maintenance task to delete files older than say 2 days. When I create
the plan the tast runs but no files are deleted. If I view the TSQL
script created it reads:
EXECUTE master.dbo.xp_delete_file
0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
part of the problem.
Searching for info on msdn and books online yields no info on
xp_delete_file. Searching the MS support forums, google groups etc I
can find lots of messages where users are asking for assistance on how
to use this or why it doesn't work yet no one has an answer.
Considering the amount of money we just laid down for this product I am
absolutely astounded how little testing has gone into this maintenance
plans area.
Any MVPs have any ideas, or any one else found a work around on this.
Anyone know anyone on the Development team who can shed some light on
what this, why it doesn't work out of the box, and what can be done to
fix it?
Stew
I would like to find out more information on this as well. I will try to dig
a little deeper (again) and see if I can get someone to document this
feature. I will let you know if I find anything. IN the meantime try
running this manually in the query editor and see if it works as expected:
EXECUTE master.dbo.xp_delete_file
0,N'G:\sql_back_full',N'bak',N'20051218 16:25:00'
Andrew J. Kelly SQL MVP
<windsurfing_stew@.yahoo.com.au> wrote in message
news:1135056599.840877.305720@.g14g2000cwa.googlegr oups.com...
> Hi,
> I'm hoping that someone can help me out. I am trying to add a
> maintenance task to delete files older than say 2 days. When I create
> the plan the tast runs but no files are deleted. If I view the TSQL
> script created it reads:
> EXECUTE master.dbo.xp_delete_file
> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
> part of the problem.
> Searching for info on msdn and books online yields no info on
> xp_delete_file. Searching the MS support forums, google groups etc I
> can find lots of messages where users are asking for assistance on how
> to use this or why it doesn't work yet no one has an answer.
> Considering the amount of money we just laid down for this product I am
> absolutely astounded how little testing has gone into this maintenance
> plans area.
> Any MVPs have any ideas, or any one else found a work around on this.
> Anyone know anyone on the Development team who can shed some light on
> what this, why it doesn't work out of the box, and what can be done to
> fix it?
> Stew
>
|||Hi Andrew,
Thanks for your suggestion. I have tried this and unfortunately it
wasn't successful.
If you could 'dig a little deeper' to help on this one I'd be
particularly appreciative.
Looking forward to your response.
Stewart
|||Any movement on this. Same problem. This is ridiculous.
"windsurfing_stew@.yahoo.com.au" wrote:

> Hi,
> I'm hoping that someone can help me out. I am trying to add a
> maintenance task to delete files older than say 2 days. When I create
> the plan the tast runs but no files are deleted. If I view the TSQL
> script created it reads:
> EXECUTE master.dbo.xp_delete_file
> 0,N'G:\sql_back_full',N'bak',N'12/18/2005 16:25:00'
> I'm in Australia where the 18th Dec is 18/12/05. Not sure if that is
> part of the problem.
> Searching for info on msdn and books online yields no info on
> xp_delete_file. Searching the MS support forums, google groups etc I
> can find lots of messages where users are asking for assistance on how
> to use this or why it doesn't work yet no one has an answer.
> Considering the amount of money we just laid down for this product I am
> absolutely astounded how little testing has gone into this maintenance
> plans area.
> Any MVPs have any ideas, or any one else found a work around on this.
> Anyone know anyone on the Development team who can shed some light on
> what this, why it doesn't work out of the box, and what can be done to
> fix it?
> Stew
>
|||Nothing yet. Unfortunately the timing was wrong due to the holidays. I
think a lot of the SQL Dev team members took a long awaited vacation over
Christmas & New Years. I will ping them again.
Andrew J. Kelly SQL MVP
"Scott" <Scott@.discussions.microsoft.com> wrote in message
news:C86196B0-95AF-4EE2-B654-A2266D7FBE22@.microsoft.com...[vbcol=seagreen]
> Any movement on this. Same problem. This is ridiculous.
> "windsurfing_stew@.yahoo.com.au" wrote:
|||As far as I can tell, the new "cleanup" task can remove old files in a
single directory, but will not recurse. It took me a while to figure out I
had to specify a file extension and NOT include the leading "." in order to
get it to delete old .trn files. I now have all backups in a single folder,
instead of creating a new folder for each database. I also have two cleanup
tasks created to get rid of old .bak and another for .trn files. It's
functional now, but not evident when setting up.
This is a kludge. I would much rather have separate directories for old
backup files. The cleanup tool needs an option to recurse through
subdirectories when deleting files.
I agree that the backup options are a step backwards for SQL 2005.
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:%23OBaViJEGHA.532@.TK2MSFTNGP15.phx.gbl...
> Nothing yet. Unfortunately the timing was wrong due to the holidays. I
> think a lot of the SQL Dev team members took a long awaited vacation over
> Christmas & New Years. I will ping them again.
> --
> Andrew J. Kelly SQL MVP
>
> "Scott" <Scott@.discussions.microsoft.com> wrote in message
> news:C86196B0-95AF-4EE2-B654-A2266D7FBE22@.microsoft.com...
>

Problems with Lookup task and dates

I’m trying to make a Lookup transformation with a relation on two string columns and a between dates condition set by parameter:

select * from
(select * from [dbo].[RgnErhverv_Ansvar]) as refTable
where [refTable].[Opretdato] = ? and ? between StartDate and EndDate

where the second parameter is my Date column (FakturaDato_konv) .

My problem is that I keep getting the error:

"Error 1 Validation error. Data Flow Task: Lookup [16505]: input column "FakturaDato_konv" (17826) has a datatype which cannot be joined on"

The StartDate and EndDate is datetime data type and have tried all of the DATE data types for the "FakturaDato_konv" without any luck - DT_DBTIMESTAMP should be the one.

FakturaDato_konv looks like this 24-06-2005 00:00:00
StartDate looks like this 31-08-2001 00:00:00

Any suggestions?

-Jeppe

I tried your lookup string in here and received no error so I don't know specifically what your problem is. You mention above 2 strings and a date but your SQL only has 2 parameters so maybe that is the problem. You should look at the parameters dialog to see if the columns are being joined as you expect. That all being said lookup is a one to one lookup so in general what you are trying to do won't work even if you get the SQL statement problem ironed out.

Thanks,|||

The first parameter is a string value and the second is the date value. The string value is working fine but the date value is causing me problems. I have mapped the parameters to the correct columns in the parameters dialog and manually added the date column (second parameter) to the input columns the advanced editor.

The two date values in my post represent the second parameter and one of the date values in the lookup table – they are same format but I keep getting the has a datatype which cannot be joined on?

I have tried joining on only one date parameter.. same error.

Thanks
-Jeppe

|||

Are there any other errors posted? Have you tried fully qualifying startdate and enddate (e.g. [reftable].[startdate])? Error 1 does not look like an error we post did you cut and paste the entire error (i.e. our errors look like 0xCxxxxxxx)? As I asked previously did you look at the parameter dialog to see the mapping? Did you verify that the metadata for the dataflow column is the type you expect it is?

Thanks,

|||

The warning i like the one I posted and the error messagebox is:

TITLE: Package Validation Error

Package Validation Error


ADDITIONAL INFORMATION:

Error at Data Flow Task [Lookup [18314]]: input column "FakturaDato_konv" (18427) has a datatype which cannot be joined on.

Error at Data Flow Task [DTS.Pipeline]: "component "Lookup" (18314)" failed validation and returned validation status "VS_ISBROKEN".

Error at Data Flow Task [DTS.Pipeline]: One or more component failed validation.

Error at Data Flow Task: There were errors during task validation.

(Microsoft.DataTransformationServices.VsIntegration)


BUTTONS:

OK
The log says:

[DTS.Pipeline] Error: The ProcessInput method on component "Lookup" (18314) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running.

I have checked the column mappings and the format in metadata. I also tried a simpel lookup only on one of the date columns - samme error.

Maybe my package is corrupted?

Thanks
-Jeppe

|||I found the error Idea

The date column (FakturaDato) had to be mapped to one of the lookup date columns (StartDate or EndDate) - it's not enough that the string column (Ansvar) was mapped and the date columns manually added as input columns in the advanced editor.

Hope this makes sense

Thanks
-Jeppe

Monday, March 12, 2012

Problems with FTP Task

I'm relatively new to the SSIS package creation scene and I'm running into a problem with the FTPTask. I'm trying to create a package that will let me download a file from an FTP. I'm trying to use a variable and an expression to set the filename at runtime because the name of the file changes on a daily basis (read: timestamp on the end of the file).
I've managed to get the connection to point to the proper directory, but every time I attempt to run the package I receive a file not found error. If I change the remotepath variable to a static file instead of an expression I do not receive an error.

Any help would be greatly appreciated as I'm losing my mind on this one.

Thanks
Where are you building the expression for the variable?|||Within the variable properties window of BIDS. I set EvaluateAsExpression to true, when I check the parameter on the values portion of the properties window it looks correct.

|||What OS is the FTP server running?|||Near as I can tell Unix, from what I've been reading it's looking like I have to find another way around the problem.
|||

E_DJ wrote:

Near as I can tell Unix, from what I've been reading it's looking like I have to find another way around the problem.

If it's Unix, then yeah, you'll have to implement FTP using the script task.|||Thanks for your help, do you know if MS has any sort of plan to deal with this issue or is it like most things where we're going to have to wait for the next release before anything is addressed?
|||Let's see:

[Microsoft follow-up]

MSFT - When do you plan on fixing the FTP Task when used against non-Microsoft FTP servers?|||

You said "I'm trying to use a variable and an expression to set the filename at runtime".

Can you give me a little more information how you are setting the variable and expression? I just want to make sure I understand your problem.

Also, what's the error message(s)? Thanks.

|||

Cho Yeung - msft wrote:

You said "I'm trying to use a variable and an expression to set the filename at runtime".

Can you give me a little more information how you are setting the variable and expression? I just want to make sure I understand your problem.

Also, what's the error message(s)? Thanks.

Cho, forget about the variable and expression. The issue here is FTP Task support for non-Microsoft FTP servers.

|||

Cho Yeung - msft wrote:

You said "I'm trying to use a variable and an expression to set the filename at runtime".

Can you give me a little more information how you are setting the variable and expression? I just want to make sure I understand your problem.

Also, what's the error message(s)? Thanks.

Specifically, the problem lies in the requirement to have a leading "/" on all remote file paths. This isn't correct and should be removed.

Connect items already out there:

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=281893

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=150196

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125356

Basically, having the leading "/" requirement and then implementing a change directory to that "/" can cause the FTP Task to fail because it cannot find the file (because you've changed to the FTP root instead of the logged-in user's root path). Instead, I propose you guys look into the following: First, don't change directories. Second STOP running a directory listing to compare the file requested to the returned list. (Why? Because based on some of the Connect submissions above, the task doesn't know how to parse it.) PLEASE, just implement an FTP task that submits the commands directly instead of trying to make an "intelligent" FTP Task.

[Microsoft follow-up]

|||

I am asking because the original post says

" If I change the remotepath variable to a static file instead of an expression I do not receive an error."

It sounds to me like the package is working if the file is specified explicitly.

|||

That is the case, and hence the question, doesn't really make a whole lot of sense as to why it wasn't working.

I know it's not a directory change issue, I took into account that the actual path on the FTP doesn't match the path I see when I log on via the command prompt, once I worked out the filepath from the root dir it fixed that problem.

This is a bit of a moot point now, I wrote a script task to do what I needed it to. Little odd that it took me a half hour to get something working writing a script that took several hours to get to the same point using the FTPTask component.

|||

I am going to log a bug in our system so we can track this potential problem.

Monday, February 20, 2012

Problems Using Temporary Tables

I am declaring a temp table in control flow via Execute SQL task. I then want to use that table as a source in a data task, keep it alive going back to control flow and use it as a destination in another data task following. I am having trouble just getting the first data flow to access that temp table.

In my Execute SQL task, I'm creating a simple temp table. After executing that task, I can head to the data task and change my OLE DB Source to point to that temp table, but I recieve an error about an invalid table name when I attempt to map columns or hit "OK."

Is there something else I need to do to use that temp table as a source or can I only reference it through SQL queries?

Thank you.

I have found them to be unreliable and problematic to use in SSIS. The meta-data issues during dev. for example are a real pain, and the difficulty of controlling the lifetime of the temp tables is another.

I am now using table variables where I previously used temp tables. Table variables are typically faster for small row counts but slower with greater row counts. Unfortunately, I am using them for greater row counts and my sql statement went from 5 1/2 minutes to 8 1/2 minutes for about 250,000 rows.

|||How would I go about doing that though? I would like to try it out even though I'm aware of the limited success.
|||

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

|||

Although you can use temporary tables in tempdb (#MyTempTable) by setting RetainSameConnection, you might prefer creating a temporary table in an ordinary database (MyTempTable), without setting RetainSameConnection:

Create the table ahead of time. Truncate it before using it on each invocation.

Cheers/Kristian

|||

kenambrose wrote:

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

Right, I've seen this answer before, and actually did this. It allowed me to see the temp table after executing the task (as #TempTable_0283817, or something similar) but when I select it, I recieve an error.

I will reply later with the specific error in a few hours when I can get to the SQL box.
|||Here is the error message that pops up when I try to map columns to the temp table I chose from the drop down.

TITLE: Microsoft Visual Studio

Error at Data Flow Task [OLE DB Destination [340]]: An OLE DB error has occurred. Error code: 0x80040E37.

Error at Data Flow Task [OLE DB Destination [340]]: Opening a rowset for "[dbo].[#TestTable_000000002219]" failed. Check that the object exists in the database.

ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

BUTTONS:

OK

|||

Yes that works of course but then the SSIS user context needs "create object" and "write" permissions on the source data server (unless you are willing to suffer the performance disaster of heterogenerous joins). Bad and/or impossible for most extraction scenarios.....

Ken

|||That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian|||

Kristian Wedberg wrote:

That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian

When you say "staging database" are you referring to an object in the SSIS package or is that just a general term?

Basically, what I want to do is run through the entire input file, validate it, and record any errors I find before inserting any DB records.
|||

In my use of temp tables and the OLE DB Source or Destination I have resorted to using the Advanced Editor where you can create the columns and mappings "by hand". An easy way to see how to set them up is to create a table in your dev db that looks like your temp table. Set up the source or destination using that table and map your columns. Then open up the Advanced Editor.

One thing I found with temp tables. Of course you know about the RetainSameConnection setting. I was using the same connection to create the temp table, fill it, then open it so that I could write to another table on the same connection. Where I write to another table on the same connection I had to create a new separate connection and use it to write to the other table. Otherwise it seemed the viability of the temp table was uncertain when I run a second parallel data flow task where that temp table would be used as well.

Put another way, I use one connection to create the temp table, fill it and read from it. I do not use that same connection to write or read from any other tables. This may not be effecient but it was the only way I could get things to work in parallel.

Hope this helps,
David Martin

|||We are loading data from several source systems simultaneously. Each system generates a set of identical files using the Raw Data File destination. All extracts share common load procedures that pick up the generated Raw Data files through an expression variable. It's a pretty slick way around temp tables and seems to work pretty fast. Would be nicer if there was a Recordset source and we didn't have to create the file on the server but for now there isn't one. You may want to look at that approach as a way around temporary tables.|||

Martin is absolutely right. Raw files are akin to temp tables.

He is correct that there is no recordset source (and with good reason) but you can build one yourself as explined here: http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx

You can't append to a recordset destination unfortunately. If you think that would be nice functionality to have then vote for it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6831c0b9-ef74-4132-a137-b073a950d3fd

-Jamie

|||I meant "staging database" as a general term, i.e. it's often useful for the SSIS part to have access to a database where it can write and read arbitrary tables, even if that database is different from both your source database and your target database.|||

<< we didn't have to create the file on the server >>

That's fine if:

a: Your package runs local to your source data (very rare I expect)

or

b: You do not need to reference temp data structures in the queries that populate the raw data files.

But when you need the functionality of temporary data structures when working with queries that reference remote source data, it's either heterogenerous joins (death to performance) or table variables.

Ken

Problems Using Temporary Tables

I am declaring a temp table in control flow via Execute SQL task. I then want to use that table as a source in a data task, keep it alive going back to control flow and use it as a destination in another data task following. I am having trouble just getting the first data flow to access that temp table.

In my Execute SQL task, I'm creating a simple temp table. After executing that task, I can head to the data task and change my OLE DB Source to point to that temp table, but I recieve an error about an invalid table name when I attempt to map columns or hit "OK."

Is there something else I need to do to use that temp table as a source or can I only reference it through SQL queries?

Thank you.

I have found them to be unreliable and problematic to use in SSIS. The meta-data issues during dev. for example are a real pain, and the difficulty of controlling the lifetime of the temp tables is another.

I am now using table variables where I previously used temp tables. Table variables are typically faster for small row counts but slower with greater row counts. Unfortunately, I am using them for greater row counts and my sql statement went from 5 1/2 minutes to 8 1/2 minutes for about 250,000 rows.

|||How would I go about doing that though? I would like to try it out even though I'm aware of the limited success.|||

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

|||

Although you can use temporary tables in tempdb (#MyTempTable) by setting RetainSameConnection, you might prefer creating a temporary table in an ordinary database (MyTempTable), without setting RetainSameConnection:

Create the table ahead of time. Truncate it before using it on each invocation.

Cheers/Kristian

|||

kenambrose wrote:

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

Right, I've seen this answer before, and actually did this. It allowed me to see the temp table after executing the task (as #TempTable_0283817, or something similar) but when I select it, I recieve an error.

I will reply later with the specific error in a few hours when I can get to the SQL box.|||Here is the error message that pops up when I try to map columns to the temp table I chose from the drop down.

TITLE: Microsoft Visual Studio

Error at Data Flow Task [OLE DB Destination [340]]: An OLE DB error has occurred. Error code: 0x80040E37.

Error at Data Flow Task [OLE DB Destination [340]]: Opening a rowset for "[dbo].[#TestTable_000000002219]" failed. Check that the object exists in the database.

ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

BUTTONS:

OK|||

Yes that works of course but then the SSIS user context needs "create object" and "write" permissions on the source data server (unless you are willing to suffer the performance disaster of heterogenerous joins). Bad and/or impossible for most extraction scenarios.....

Ken

|||That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian|||

Kristian Wedberg wrote:

That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian

When you say "staging database" are you referring to an object in the SSIS package or is that just a general term?

Basically, what I want to do is run through the entire input file, validate it, and record any errors I find before inserting any DB records.|||

In my use of temp tables and the OLE DB Source or Destination I have resorted to using the Advanced Editor where you can create the columns and mappings "by hand". An easy way to see how to set them up is to create a table in your dev db that looks like your temp table. Set up the source or destination using that table and map your columns. Then open up the Advanced Editor.

One thing I found with temp tables. Of course you know about the RetainSameConnection setting. I was using the same connection to create the temp table, fill it, then open it so that I could write to another table on the same connection. Where I write to another table on the same connection I had to create a new separate connection and use it to write to the other table. Otherwise it seemed the viability of the temp table was uncertain when I run a second parallel data flow task where that temp table would be used as well.

Put another way, I use one connection to create the temp table, fill it and read from it. I do not use that same connection to write or read from any other tables. This may not be effecient but it was the only way I could get things to work in parallel.

Hope this helps,
David Martin

|||We are loading data from several source systems simultaneously. Each system generates a set of identical files using the Raw Data File destination. All extracts share common load procedures that pick up the generated Raw Data files through an expression variable. It's a pretty slick way around temp tables and seems to work pretty fast. Would be nicer if there was a Recordset source and we didn't have to create the file on the server but for now there isn't one. You may want to look at that approach as a way around temporary tables.|||

Martin is absolutely right. Raw files are akin to temp tables.

He is correct that there is no recordset source (and with good reason) but you can build one yourself as explined here: http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx

You can't append to a recordset destination unfortunately. If you think that would be nice functionality to have then vote for it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6831c0b9-ef74-4132-a137-b073a950d3fd

-Jamie

|||I meant "staging database" as a general term, i.e. it's often useful for the SSIS part to have access to a database where it can write and read arbitrary tables, even if that database is different from both your source database and your target database.|||

<< we didn't have to create the file on the server >>

That's fine if:

a: Your package runs local to your source data (very rare I expect)

or

b: You do not need to reference temp data structures in the queries that populate the raw data files.

But when you need the functionality of temporary data structures when working with queries that reference remote source data, it's either heterogenerous joins (death to performance) or table variables.

Ken

Problems Using Temporary Tables

I am declaring a temp table in control flow via Execute SQL task. I then want to use that table as a source in a data task, keep it alive going back to control flow and use it as a destination in another data task following. I am having trouble just getting the first data flow to access that temp table.

In my Execute SQL task, I'm creating a simple temp table. After executing that task, I can head to the data task and change my OLE DB Source to point to that temp table, but I recieve an error about an invalid table name when I attempt to map columns or hit "OK."

Is there something else I need to do to use that temp table as a source or can I only reference it through SQL queries?

Thank you.

I have found them to be unreliable and problematic to use in SSIS. The meta-data issues during dev. for example are a real pain, and the difficulty of controlling the lifetime of the temp tables is another.

I am now using table variables where I previously used temp tables. Table variables are typically faster for small row counts but slower with greater row counts. Unfortunately, I am using them for greater row counts and my sql statement went from 5 1/2 minutes to 8 1/2 minutes for about 250,000 rows.

|||How would I go about doing that though? I would like to try it out even though I'm aware of the limited success.|||

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

|||

Although you can use temporary tables in tempdb (#MyTempTable) by setting RetainSameConnection, you might prefer creating a temporary table in an ordinary database (MyTempTable), without setting RetainSameConnection:

Create the table ahead of time. Truncate it before using it on each invocation.

Cheers/Kristian

|||

kenambrose wrote:

Well, you've been warned :)

It's my understanding that the only thing you can do to SSIS to specifically facilitate the use of temp tables is to set the "retain same connection" property to "true" for the connection that is used to create the temp table, and then use that connection for all references to the table.

Ken

Right, I've seen this answer before, and actually did this. It allowed me to see the temp table after executing the task (as #TempTable_0283817, or something similar) but when I select it, I recieve an error.

I will reply later with the specific error in a few hours when I can get to the SQL box.|||Here is the error message that pops up when I try to map columns to the temp table I chose from the drop down.

TITLE: Microsoft Visual Studio

Error at Data Flow Task [OLE DB Destination [340]]: An OLE DB error has occurred. Error code: 0x80040E37.

Error at Data Flow Task [OLE DB Destination [340]]: Opening a rowset for "[dbo].[#TestTable_000000002219]" failed. Check that the object exists in the database.

ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC02020E8 (Microsoft.SqlServer.DTSPipelineWrap)

BUTTONS:

OK|||

Yes that works of course but then the SSIS user context needs "create object" and "write" permissions on the source data server (unless you are willing to suffer the performance disaster of heterogenerous joins). Bad and/or impossible for most extraction scenarios.....

Ken

|||That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian|||

Kristian Wedberg wrote:

That's what the staging database is for in most extract scenarios, I find that even creating tempdb tables on the source systems are seldom OK.

Either way, by having an authorized user creating the table before SSIS runs, it's enough to give the SSIS context insert/delete rights.

Cheers/Kristian

When you say "staging database" are you referring to an object in the SSIS package or is that just a general term?

Basically, what I want to do is run through the entire input file, validate it, and record any errors I find before inserting any DB records.|||

In my use of temp tables and the OLE DB Source or Destination I have resorted to using the Advanced Editor where you can create the columns and mappings "by hand". An easy way to see how to set them up is to create a table in your dev db that looks like your temp table. Set up the source or destination using that table and map your columns. Then open up the Advanced Editor.

One thing I found with temp tables. Of course you know about the RetainSameConnection setting. I was using the same connection to create the temp table, fill it, then open it so that I could write to another table on the same connection. Where I write to another table on the same connection I had to create a new separate connection and use it to write to the other table. Otherwise it seemed the viability of the temp table was uncertain when I run a second parallel data flow task where that temp table would be used as well.

Put another way, I use one connection to create the temp table, fill it and read from it. I do not use that same connection to write or read from any other tables. This may not be effecient but it was the only way I could get things to work in parallel.

Hope this helps,
David Martin

|||We are loading data from several source systems simultaneously. Each system generates a set of identical files using the Raw Data File destination. All extracts share common load procedures that pick up the generated Raw Data files through an expression variable. It's a pretty slick way around temp tables and seems to work pretty fast. Would be nicer if there was a Recordset source and we didn't have to create the file on the server but for now there isn't one. You may want to look at that approach as a way around temporary tables.|||

Martin is absolutely right. Raw files are akin to temp tables.

He is correct that there is no recordset source (and with good reason) but you can build one yourself as explined here: http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx

You can't append to a recordset destination unfortunately. If you think that would be nice functionality to have then vote for it here: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=6831c0b9-ef74-4132-a137-b073a950d3fd

-Jamie

|||I meant "staging database" as a general term, i.e. it's often useful for the SSIS part to have access to a database where it can write and read arbitrary tables, even if that database is different from both your source database and your target database.|||

<< we didn't have to create the file on the server >>

That's fine if:

a: Your package runs local to your source data (very rare I expect)

or

b: You do not need to reference temp data structures in the queries that populate the raw data files.

But when you need the functionality of temporary data structures when working with queries that reference remote source data, it's either heterogenerous joins (death to performance) or table variables.

Ken