Home All Groups Group Topic Archive Search About

xp_cmdshell to open/close file

Author
29 Sep 2005 3:46 PM
sqlster
Hi all,

Does any one know tsql syntax to open and close a file on network drive?

Of course this command should execute in proper security context.

TIA..

Author
29 Sep 2005 3:56 PM
Jerry Spivey
Sqlster,

What are you trying to do?  Open the file with what?

HTH

Jerry
Show quote
"sqlster" <nospam@nospam.com> wrote in message
news:89729D7E-E476-420D-872D-48795088DCE5@microsoft.com...
> Hi all,
>
> Does any one know tsql syntax to open and close a file on network drive?
>
> Of course this command should execute in proper security context.
>
> TIA..
Author
29 Sep 2005 4:23 PM
David Portas
What do you mean by "open and close a file"? You can import a file using BCP
or DTS.

--
David Portas
SQL Server MVP
--



Show quote
"sqlster" wrote:

> Hi all,
>
> Does any one know tsql syntax to open and close a file on network drive?
>
> Of course this command should execute in proper security context.
>
> TIA..
Author
29 Sep 2005 10:41 PM
sqlster
Please excuse me for not providing some background early on.

The asp.net application caches some values that its not supposed to. The new
..net code to fix that issue will not go into production for some weeks. In
the mean time, we just open/close the web.config manually to refresh the
cache.

One way to address this issue would be is to write a sql job that on a
nightly basis would simply open/close the web.config to refresh the cache.

My intention is to have a very short term solution to address this issue
immediately.

TIA...

Show quote
"David Portas" wrote:

> What do you mean by "open and close a file"? You can import a file using BCP
> or DTS.
>
> --
> David Portas
> SQL Server MVP
> --
>
>
>
> "sqlster" wrote:
>
> > Hi all,
> >
> > Does any one know tsql syntax to open and close a file on network drive?
> >
> > Of course this command should execute in proper security context.
> >
> > TIA..
Author
29 Sep 2005 10:51 PM
Jerry Spivey
I wouldn't choose T-SQL to do this.  I'd use a BAT/CMD, EXE or VBScript as a
Scheduled Task in Windows or you could use a scheduled SQL job as well.

HTH

Jerry
Show quote
"sqlster" <nospam@nospam.com> wrote in message
news:569737E7-ED64-43EA-95F5-6BD022DA62A1@microsoft.com...
> Please excuse me for not providing some background early on.
>
> The asp.net application caches some values that its not supposed to. The
> new
> .net code to fix that issue will not go into production for some weeks. In
> the mean time, we just open/close the web.config manually to refresh the
> cache.
>
> One way to address this issue would be is to write a sql job that on a
> nightly basis would simply open/close the web.config to refresh the cache.
>
> My intention is to have a very short term solution to address this issue
> immediately.
>
> TIA...
>
> "David Portas" wrote:
>
>> What do you mean by "open and close a file"? You can import a file using
>> BCP
>> or DTS.
>>
>> --
>> David Portas
>> SQL Server MVP
>> --
>>
>>
>>
>> "sqlster" wrote:
>>
>> > Hi all,
>> >
>> > Does any one know tsql syntax to open and close a file on network
>> > drive?
>> >
>> > Of course this command should execute in proper security context.
>> >
>> > TIA..

AddThis Social Bookmark Button