Showing posts with label location. Show all posts
Showing posts with label location. Show all posts

Wednesday, March 28, 2012

Renaming a local file

Suppose I have an Excel file in D:\Test with the name a.xls.
Can I rename that excel file from QA of SQL SERVER in the same location or any other location?
SubhasishYou can perform any dos commands via SQL using xp_cmdshell. You must ensure the SQL server has permissions to the location where the file resides if that location is not on the SQL server.

From QA type:

xp_cmdshell 'rename D:\Test.xls Test2.xls'

That should do the trick.

-Lee
MS SQL 2000 dba
Verizon Wireless|||you might even have an activex task to do this in your DTS package. Here is the code
======================================
Function Main()
Dim fs, MyFile
Dim FileLocation
Dim FileName
Dim FileInfo

FileLocation = "D:\Test\"
FileName = "a.xls"
FileInfo = FileLocation & FileName

Set fs = CreateObject("Scripting.FileSystemObject")

If (fs.FileExists(FileInfo)) Then
fs.MoveFile (FileInfo),(FileLocation & "new_name.xls")
set fs=nothing
Main = DTSTaskExecResult_Success
exit function
Else
Main = DTSTaskExecResult_Failure
exit function
End If

End Function
===========================================

Monday, February 20, 2012

removing alternate snapshot location setting

I was using an "alternate snapshot
location" for the storage of my reinitilized
snapshot data. All those snap shots have
made it to the subscribers. I am now
wanting to go back to those pacakges and set
their snapshot location back to default
(basically the default dir on the
distributor). When I go back and check that
check box, it's not going to try to start a
new snapshot is it?
I figured once the snapshot was done and
pushed over, that the rest of replication
would be the sync'ing part.
Thanks,
-comb
No - this doesn't cause the snapshot agent to start automatically, or mark
the subscribers for reinitialization.
It only affects things the next time you choose to run the snapshot agent.
Regards,
Paul Ibison
|||In article <OPxX59qfEHA.556
@.tk2msftngp13.phx.gbl>,
Paul.Ibison@.Pygmalion.Com says...
> No - this doesn't cause the snapshot agent to start automatically, or mark
> the subscribers for reinitialization.
> It only affects things the next time you choose to run the snapshot agent.
> Regards,
> Paul Ibison
>
>
that is perfect then.. thats the information
i needed to know..
thanks for the response..
-comb