显示标签为“ideas”的博文。显示所有博文
显示标签为“ideas”的博文。显示所有博文

2012年3月22日星期四

Flat File Destination

Hi,

How can I check if my Flat File Destinatino is empty or not?

I′m sending it with FTP, but I don′t wanna send an empty file.

Any ideas?

Thank you.

I reckon you coudl use a WMI query to get this, but to be honest I don't know how.

I would use the Script Task, just write a quick line of VB to grab the file size and stuff it in a variable. If being good you could read the filename straight off the file connection as well, e.g.

Code Snippet

Dim fileInfo As System.IO.FileInfo = New System.IO.FileInfo(Dts.Connections("Flat File Conn").ConnectionString)

Dts.Variables("FileSize").Value = fileInfo.Length

Note I created a variable called FileSize of Int64, and added it to ReadWriteVariables list of my Script Task.

Next, I would use an expression on the constraint leading from the script task to the ftp task. @.[User::FileSize] > 0, such that the expression must be satisfied to run the FTP task.

2012年2月19日星期日

firehouse mode

I just got the following message after trying to update
records in a sql table:
"transaction cannot start while in firehouse mode"
any ideas what the problem is? please advise and thanksWhat does your code look like? My suggestion is to not use recordset
objects in ADO to modify data. Send UPDATE statements instead...
http://www.aspfaq.com/
(Reverse address to reply.)
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:940101c478a1$06a5e660$a601280a@.phx.gbl...
> I just got the following message after trying to update
> records in a sql table:
> "transaction cannot start while in firehouse mode"
> any ideas what the problem is? please advise and thanks|||hi Aaron -
I am entering data directly into a table, no query.

>--Original Message--
>What does your code look like? My suggestion is to not
use recordset
>objects in ADO to modify data. Send UPDATE statements
instead...
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>
>"Lisa P" <anonymous@.discussions.microsoft.com> wrote in
message
>news:940101c478a1$06a5e660$a601280a@.phx.gbl...
>
>.
>|||Use an UPDATE statement in Query Analyzer, do not "enter data directly into
a table"...
http://www.aspfaq.com/
(Reverse address to reply.)
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:973d01c478a7$ed278c00$a301280a@.phx.gbl...[vbcol=seagreen]
> hi Aaron -
> I am entering data directly into a table, no query.
>
> use recordset
> instead...
> message|||If you are in SEM, the Jim's response is the most likely cure... Until all
of the rows which you have chosen are displayed, the cursor for displaying
those rows is still open , and the connection can not do anything else...
So scroll to the bottom, then go back up and make your changes...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:940101c478a1$06a5e660$a601280a@.phx.gbl...
> I just got the following message after trying to update
> records in a sql table:
> "transaction cannot start while in firehouse mode"
> any ideas what the problem is? please advise and thanks

firehouse mode

I just got the following message after trying to update
records in a sql table:
"transaction cannot start while in firehouse mode"
any ideas what the problem is? please advise and thanks
What does your code look like? My suggestion is to not use recordset
objects in ADO to modify data. Send UPDATE statements instead...
http://www.aspfaq.com/
(Reverse address to reply.)
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:940101c478a1$06a5e660$a601280a@.phx.gbl...
> I just got the following message after trying to update
> records in a sql table:
> "transaction cannot start while in firehouse mode"
> any ideas what the problem is? please advise and thanks
|||hi Aaron -
I am entering data directly into a table, no query.

>--Original Message--
>What does your code look like? My suggestion is to not
use recordset
>objects in ADO to modify data. Send UPDATE statements
instead...
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>
>"Lisa P" <anonymous@.discussions.microsoft.com> wrote in
message
>news:940101c478a1$06a5e660$a601280a@.phx.gbl...
>
>.
>
|||Use an UPDATE statement in Query Analyzer, do not "enter data directly into
a table"...
http://www.aspfaq.com/
(Reverse address to reply.)
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:973d01c478a7$ed278c00$a301280a@.phx.gbl...[vbcol=seagreen]
> hi Aaron -
> I am entering data directly into a table, no query.
> use recordset
> instead...
> message
|||If you are in SEM, the Jim's response is the most likely cure... Until all
of the rows which you have chosen are displayed, the cursor for displaying
those rows is still open , and the connection can not do anything else...
So scroll to the bottom, then go back up and make your changes...
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:940101c478a1$06a5e660$a601280a@.phx.gbl...
> I just got the following message after trying to update
> records in a sql table:
> "transaction cannot start while in firehouse mode"
> any ideas what the problem is? please advise and thanks

firehouse mode

I just got the following message after trying to update
records in a sql table:
"transaction cannot start while in firehouse mode"
any ideas what the problem is? please advise and thanksWhat does your code look like? My suggestion is to not use recordset
objects in ADO to modify data. Send UPDATE statements instead...
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:940101c478a1$06a5e660$a601280a@.phx.gbl...
> I just got the following message after trying to update
> records in a sql table:
> "transaction cannot start while in firehouse mode"
> any ideas what the problem is? please advise and thanks|||hi Aaron -
I am entering data directly into a table, no query.
>--Original Message--
>What does your code look like? My suggestion is to not
use recordset
>objects in ADO to modify data. Send UPDATE statements
instead...
>--
>http://www.aspfaq.com/
>(Reverse address to reply.)
>
>
>"Lisa P" <anonymous@.discussions.microsoft.com> wrote in
message
>news:940101c478a1$06a5e660$a601280a@.phx.gbl...
>> I just got the following message after trying to update
>> records in a sql table:
>> "transaction cannot start while in firehouse mode"
>> any ideas what the problem is? please advise and thanks
>
>.
>|||Use an UPDATE statement in Query Analyzer, do not "enter data directly into
a table"...
--
http://www.aspfaq.com/
(Reverse address to reply.)
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:973d01c478a7$ed278c00$a301280a@.phx.gbl...
> hi Aaron -
> I am entering data directly into a table, no query.
> >--Original Message--
> >What does your code look like? My suggestion is to not
> use recordset
> >objects in ADO to modify data. Send UPDATE statements
> instead...
> >
> >--
> >http://www.aspfaq.com/
> >(Reverse address to reply.)
> >
> >
> >
> >
> >"Lisa P" <anonymous@.discussions.microsoft.com> wrote in
> message
> >news:940101c478a1$06a5e660$a601280a@.phx.gbl...
> >> I just got the following message after trying to update
> >> records in a sql table:
> >> "transaction cannot start while in firehouse mode"
> >> any ideas what the problem is? please advise and thanks
> >
> >
> >.
> >|||SYMPTOMS
If you attempt to make changes to a row in a table
displayed in SQL Server Enterprise Manager (SEM), unless
you scroll down to the end of the table (the last row of
the table), Enterprise Manager returns the following
error:
Cannot start transaction while in firehose mode.
CAUSE
When using SEM to display the rows from a table, all rows
are returned by a "firehose cursor"; however, only the
rows that are displayed have been processed. A "firehose
cursor" refers to how the server sends rows to the client
as fast as the client can process them. Rows that are not
displayed in the Enterprise Manager are not processed and,
therefore, they remain in the network buffer.
The "Cannot start transaction while in firehose mode"
error occurs when an OLE-DB provider attempts to perform a
join transaction with results pending and while not in an
updateable cursor mode.
WORKAROUND
Scroll all the way down to the last row of the table. This
forces all the rows to be processed. You can then edit the
row needed and execute the update.
>--Original Message--
>I just got the following message after trying to update
>records in a sql table:
>"transaction cannot start while in firehouse mode"
>any ideas what the problem is? please advise and thanks
>.
>|||thanks Jim, I'll try it - Aaron's suggestion did not work.
regards!
>--Original Message--
>SYMPTOMS
>If you attempt to make changes to a row in a table
>displayed in SQL Server Enterprise Manager (SEM), unless
>you scroll down to the end of the table (the last row of
>the table), Enterprise Manager returns the following
>error:
>Cannot start transaction while in firehose mode.
>CAUSE
>When using SEM to display the rows from a table, all rows
>are returned by a "firehose cursor"; however, only the
>rows that are displayed have been processed. A "firehose
>cursor" refers to how the server sends rows to the client
>as fast as the client can process them. Rows that are not
>displayed in the Enterprise Manager are not processed
and,
>therefore, they remain in the network buffer.
>The "Cannot start transaction while in firehose mode"
>error occurs when an OLE-DB provider attempts to perform
a
>join transaction with results pending and while not in an
>updateable cursor mode.
>WORKAROUND
>Scroll all the way down to the last row of the table.
This
>forces all the rows to be processed. You can then edit
the
>row needed and execute the update.
>
>>--Original Message--
>>I just got the following message after trying to update
>>records in a sql table:
>>"transaction cannot start while in firehouse mode"
>>any ideas what the problem is? please advise and thanks
>>.
>.
>|||> Aaron's suggestion did not work.
What does "did not work" mean?
--
http://www.aspfaq.com/
(Reverse address to reply.)|||If you are in SEM, the Jim's response is the most likely cure... Until all
of the rows which you have chosen are displayed, the cursor for displaying
those rows is still open , and the connection can not do anything else...
So scroll to the bottom, then go back up and make your changes...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Lisa P" <anonymous@.discussions.microsoft.com> wrote in message
news:940101c478a1$06a5e660$a601280a@.phx.gbl...
> I just got the following message after trying to update
> records in a sql table:
> "transaction cannot start while in firehouse mode"
> any ideas what the problem is? please advise and thanks