Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts

Wednesday, March 28, 2012

Renaming a File to include Date and Time

Hi

I am trying to move a flat file to an archive folder and then rename the file to include the date and time of runtime.

I have set up a File System Task to move the file which works fine and a second File System Task to rename. The IsDestinationPathVariable is set to TRUE and the DestinationVariable is called User::Error_Log_File_Rename. There is an expression as follows:

@.[User::Error_Log_File_Rename] = "Y:\\SSIS_PUD_Upload\\Error_Log_Archive\\Update_Error_Messages - " +REPLACE((DT_WSTR, 30)(DT_DBDATE)GETDATE() + "-" + (DT_WSTR, 30)(DT_DBTIME)GETDATE(),":","-") +".txt"

which is the required file name.

If I go into the expression and evaluate it it will give me the current date and time. However when I run it as part of the package say 10 minutes later the file is renamed using the same date and time from 10 minutes before when I evaluated the expression. If I wait another 10 minutes and run the package again it still retains the original date and time.

Is there a way to get the expression evaluated with the current date and time during execution of the package?

Thanks in advance

Scott

Are you using the expression section of the properties for the variable, User::Error_Log_File_Rename? And you have EvaluateAsExpression set to true?|||

Hi Phil

I have the variable in the expression section in the properties but I cannot see a 'EvaluateAsExpression' setting that I can set to true?

Where would i see this?

Thanks

Scott

|||

Racsco wrote:

Hi Phil

I have the variable in the expression section in the properties but I cannot see a 'EvaluateAsExpression' setting that I can set to true?

Where would i see this?

Thanks

Scott

Scott,

Select your variable in the variables panel and press F4. This will bring up the properties panel, displaying the properties of the variable. One of the properties is called EvaluateAsExpression. Set it to TRUE.

-Jamie

Tuesday, March 20, 2012

Removing Windows User from the Security folder

Can't seem to locate the stored procedure for removing a Windows Authenticat
ed User from the Security folder.
sp_droplogin doesn't seem to work. It only works on SQL Logins.
Can't find what appears to be proper procedure in Master database.
What I get is the message "The Login [login name] doesn't exist".
Thanks for any help.
ScottSee sp_revokelogin in Books On Line, sp_droplogin is for SQL logins.
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Scott" <scasti1@.cox.net> wrote in message
news:E38AC590-50C0-44B3-BDA2-91FCC0E43CB3@.microsoft.com...
> Can't seem to locate the stored procedure for removing a Windows
Authenticated User from the Security folder.
> sp_droplogin doesn't seem to work. It only works on SQL Logins.
> Can't find what appears to be proper procedure in Master database.
> What I get is the message "The Login [login name] doesn't exist".
> Thanks for any help.
> Scott
>

Friday, March 9, 2012

removing logs

I have over 200 log files with a date and timestamp in the filename in the
Reporting Services\LogFiles folder that are 33MB each. This is a development
machine. How do I get rid of them? Can I just delete them?
Thanks,
--
Dan D.You can delete, it creates again, but I dont think you require this much log
files for your development server. For production yes you need to have a
backup. Before deleting keep a backup or Zip all the log files and keep it in
a seperate place.
If it is so important, you can run a program which is available in the
samples to read the log files and reporting.
and ofcourse schedule it to remove. default it keeps it for 60 days.
Amarnath
"Dan D." wrote:
> I have over 200 log files with a date and timestamp in the filename in the
> Reporting Services\LogFiles folder that are 33MB each. This is a development
> machine. How do I get rid of them? Can I just delete them?
> Thanks,
> --
> Dan D.|||I never thought about log files for reportserver. Most of the files are
small, under 50K. I don't know what was in the files that were so large.
I removed them.
Thanks,
--
Dan D.
"Amarnath" wrote:
> You can delete, it creates again, but I dont think you require this much log
> files for your development server. For production yes you need to have a
> backup. Before deleting keep a backup or Zip all the log files and keep it in
> a seperate place.
> If it is so important, you can run a program which is available in the
> samples to read the log files and reporting.
> and ofcourse schedule it to remove. default it keeps it for 60 days.
> Amarnath
> "Dan D." wrote:
> > I have over 200 log files with a date and timestamp in the filename in the
> > Reporting Services\LogFiles folder that are 33MB each. This is a development
> > machine. How do I get rid of them? Can I just delete them?
> >
> > Thanks,
> > --
> > Dan D.