Showing posts with label operation. Show all posts
Showing posts with label operation. Show all posts

Wednesday, March 28, 2012

Help getting error when using operation rename a file in the File system task editor?

Does anyone know how to do this using variables? Everytime I try it, I get the

Error: Failed to lock variable for read access with error 0xc00100001.

I also tried it writing a script and still the same error. If I hard code the values into the variables it works fine but I will be running this everday so that it will pull in the current date along with the filename. So the value of the variables will change everyday. Here is my expression:

@.[User::Variable] +(DT_WSTR,4) YEAR( GETDATE() )+"0"+(DT_WSTR,2) MONTH( GETDATE() ) + (DT_WSTR,2) DAY( GETDATE() )

The result:

C:\Documents and Settings\mroush\Desktop\OSU20060818

the 20060818 part will change everyday ie.(tomorrow will be 20060819, next day 20060820 and so on.)

I am not sure how you are doing this, were is the expression and which variable is selected in the File System Task editor.

How about this-

Create a variable called Filename.

Then go to the Properties grid for the Filename variable and set the EvaluateAsExpression to true. Now set the Expression property to your expression.

Now go back to the File System Task, and select variable Filename for the operation you want.

Is this what you have done or not?

Do you really need to rename the file? Normally I would use an Expression, like you have above, but on the ConnectionString property for my File/FlatFile connection, such that when I use the connection it automatically gets the "current" filename.

|||

Darren, thanks for the reply and

yes I done this in the expression property of the variable and set it to true, that works except it adds the file name twice. The result is below.

C:\Documents and Settings\mroush\Desktop\Cnet Apps File\Apps0821.txt0821.txt

How do I get it to only evaluate once and and it looks like everyday that it runs, it is going to just keep adding to the string? Is there away to make it clear the old filename before renaming the current one everyday or is there another way to do this? I have to rename the file with the current date everyday, instead of using 1 filename and setting the overwrite destination to true. Maybe this can't be done using this task?

Mike

|||

I don't get why there appears to be two filename parts. You have got two variables, one for the base path an then one for the full filename, upon which you set the expression?

Creating a new file everyday should be fine using an expression. If you are exporting thsi file, then why not set the expression on the flat file connection manager's connection string property, and save the extra step of the rename.

|||

Hi Darren, thanks again for responding.

Here are the two files that I am working with:

The file comes in everyday and is zipped as AAA20060822 with no extension. The numbers are the date and it changes everyday with the current date so I need the expression to get that date everyday when a new file appears. Like tomorrows file will be AAA20060823

The filename that I need to rename it as is BBBB0822.txt. It has to be renamed this way with the date format this way. I'm using 2 variables so that the dates are updated everyday automatically so that the task can be scheduled nightly. I know this is confusing but this is how the file comes in everday and this is how it needs to be renamed so the data can be processed correctly through our mainframe.

I've tried setting the isdestination and issourcepath variables to true and using the expressions in the source and destination properties through the expressions option but it errors telling me that it can't lock the variables or the variables have been renamed or do not exist in the container. Error 0xC00100001

So then I tried putting the expressions in the variables expression property and setting the evaluateasexpression property to true but it evaluates the expression twice each time I run the task adding the dates twice to the path causing it not to find the source file. I'm stupmed! I don't know what else to do? I works either way without an expression hard coding the filenames but not using variables that will change everday with the date?

Thanks,

mike

Wednesday, March 21, 2012

Help Cannot resolve collation conflict for equal to operation.

Hello,
I am trying to setup replication for a database and I get the following
error. This is the content database of WSS. I noticed that the collation was
set for: Latin1_General_CI_AS_KS_WS which is diffent from our normal
collation setting SQL_Latin1_General_CP1_CI_AS, however I created the
rplDatabase with the same collation. Any help would be greatly appreciated.
Jake
Error Message:
The schema script '\\SERVER\D$\Program Files\Microsoft SQL
Server\MSSQL$DBSERVER\ReplData\unc\SERVER$DBSERVER _STS_WCPC-L-02_Content_STS
_WCPC_L_02_Content\20040416221336\proc_FindDocs_16 .sch' could not be
propagated to the subscriber.
Error Details:
The schema script '\\SERVER\D$\Program Files\Microsoft SQL
Server\MSSQL$DBSERVER\ReplData\unc\SERVER$DBSERVER _STS_WCPC-L-02_Content_STS
_WCPC_L_02_Content\20040416221336\proc_FindDocs_16 .sch' could not be
propagated to the subscriber.
(Source: Merge Replication Provider (Agent); Error number: -2147201001)
Cannot resolve collation conflict for equal to operation.
(Source: SERVER\DBSERVER (Data source); Error number: 446)
are you replicating to a SQL 7 database?
If you so you to configure your publication for this in the Specify
Subscriber Types dialog box of the create publication wizard. Otherwise in
the specify articles dialog of the same wizard click on the browse button to
the right of the articles and in the snpashot tab, select the collation tab.
"Jake" <rondican@.hotmail.com> wrote in message
news:%23RV1LCEJEHA.2380@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I am trying to setup replication for a database and I get the
following
> error. This is the content database of WSS. I noticed that the collation
was
> set for: Latin1_General_CI_AS_KS_WS which is diffent from our normal
> collation setting SQL_Latin1_General_CP1_CI_AS, however I created the
> rplDatabase with the same collation. Any help would be greatly
appreciated.
> Jake
> Error Message:
> The schema script '\\SERVER\D$\Program Files\Microsoft SQL
>
Server\MSSQL$DBSERVER\ReplData\unc\SERVER$DBSERVER _STS_WCPC-L-02_Content_STS
> _WCPC_L_02_Content\20040416221336\proc_FindDocs_16 .sch' could not be
> propagated to the subscriber.
> Error Details:
> The schema script '\\SERVER\D$\Program Files\Microsoft SQL
>
Server\MSSQL$DBSERVER\ReplData\unc\SERVER$DBSERVER _STS_WCPC-L-02_Content_STS
> _WCPC_L_02_Content\20040416221336\proc_FindDocs_16 .sch' could not be
> propagated to the subscriber.
> (Source: Merge Replication Provider (Agent); Error number: -2147201001)
> ----
--
> --
> Cannot resolve collation conflict for equal to operation.
> (Source: SERVER\DBSERVER (Data source); Error number: 446)
> ----
--
> --
>
|||Jake,
Am I right to conclude that you have included the stored procedure
[proc_FindDocs.....] as an article in your publication? If yes, then the
error is occurring while applying the stored procedure to the subscriber,
because it contains code that is comparing two values (e.g. columns or
variables) of different data types. You could try to apply the stored
procedure script manually (through Query Analyser) to the subscriber
database to see if you get the same error. If yes, then analyse the stored
procedure to see which columns are involved and check their collation. This
should give you an indication of where the collation problem is occurring.
Hope the above helps.
Raj Moloye

Friday, March 9, 2012

Help - the replication Failed to Run

error i get from replication when i force them to run the process.
mircosoft sql - DMO(ODBC sql state:42000)
Error 14258: Cannot perform this operation while sqlserveragent is
starting.try again.
But i not restart any sqlserveragent And the sql server servies manager show
that all running.
hope can get asnwer as soon as posible .
thanks.
does this help?
http://support.microsoft.com/default.aspx/kb/303287
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"sam" <sam@.discussions.microsoft.com> wrote in message
news:04A2D6ED-C57E-49EF-8952-50E082F5109F@.microsoft.com...
> error i get from replication when i force them to run the process.
> mircosoft sql - DMO(ODBC sql state:42000)
> Error 14258: Cannot perform this operation while sqlserveragent is
> starting.try again.
> But i not restart any sqlserveragent And the sql server servies manager
> show
> that all running.
> hope can get asnwer as soon as posible .
> thanks.