|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Copy file from an SQL procedureIs possible copy a file from a directory to another, from a SQL procedure?
Thanks, Rui Oliveira Hi
Yes , take a look at xp_cmdshell system stored procedure Show quote "Rui Oliveira" <RuiOlive***@discussions.microsoft.com> wrote in message news:6CEFF955-977A-4E46-AF82-976DEA5FF56C@microsoft.com... > Is possible copy a file from a directory to another, from a SQL procedure? > > Thanks, > Rui Oliveira > Works.
Tks Show quote "Uri Dimant" wrote: > Hi > Yes , take a look at xp_cmdshell system stored procedure > > "Rui Oliveira" <RuiOlive***@discussions.microsoft.com> wrote in message > news:6CEFF955-977A-4E46-AF82-976DEA5FF56C@microsoft.com... > > Is possible copy a file from a directory to another, from a SQL procedure? > > > > Thanks, > > Rui Oliveira > > > > > Rui Oliveira wrote:
> Is possible copy a file from a directory to another, from a SQL procedure? You could call xp_cmdshell to execute an external program to performthe copy. Maybe in SQL Server 2005 you could write a CLR procedure? Chris
I'd suggest using CLR only if you make sure that the task cannot perform by using T-SQL. CLR has some overhead , thus for such 'simple' operation i'd go with T-SQL Show quote "Chris Lim" <blackca***@hotmail.com> wrote in message news:1155204547.932467.83000@h48g2000cwc.googlegroups.com... > Rui Oliveira wrote: >> Is possible copy a file from a directory to another, from a SQL >> procedure? > > You could call xp_cmdshell to execute an external program to perform > the copy. > > Maybe in SQL Server 2005 you could write a CLR procedure? > I would not describe using xp_cmdshell as "using T-SQL". It is using
the operating system command prompt, and it has far greater security issues than writing a specialized CLR. It is also vastly simpler and quicker to implement, of course. Roy Harvey Beacon Falls, CT Show quote On Thu, 10 Aug 2006 13:29:45 +0300, "Uri Dimant" <u***@iscar.co.il> wrote: >Chris >I'd suggest using CLR only if you make sure that the task cannot perform by >using T-SQL. CLR has some overhead , thus for such 'simple' >operation i'd go with T-SQL > > >"Chris Lim" <blackca***@hotmail.com> wrote in message >news:1155204547.932467.83000@h48g2000cwc.googlegroups.com... >> Rui Oliveira wrote: >>> Is possible copy a file from a directory to another, from a SQL >>> procedure? >> >> You could call xp_cmdshell to execute an external program to perform >> the copy. >> >> Maybe in SQL Server 2005 you could write a CLR procedure? >> > Agreed
Show quote "Roy Harvey" <roy_har***@snet.net> wrote in message news:ek8md21anl2d98us59k0g3huj95im7etct@4ax.com... >I would not describe using xp_cmdshell as "using T-SQL". It is using > the operating system command prompt, and it has far greater security > issues than writing a specialized CLR. It is also vastly simpler and > quicker to implement, of course. > > Roy Harvey > Beacon Falls, CT > > On Thu, 10 Aug 2006 13:29:45 +0300, "Uri Dimant" <u***@iscar.co.il> > wrote: > >>Chris >>I'd suggest using CLR only if you make sure that the task cannot perform >>by >>using T-SQL. CLR has some overhead , thus for such 'simple' >>operation i'd go with T-SQL >> >> >>"Chris Lim" <blackca***@hotmail.com> wrote in message >>news:1155204547.932467.83000@h48g2000cwc.googlegroups.com... >>> Rui Oliveira wrote: >>>> Is possible copy a file from a directory to another, from a SQL >>>> procedure? >>> >>> You could call xp_cmdshell to execute an external program to perform >>> the copy. >>> >>> Maybe in SQL Server 2005 you could write a CLR procedure? >>> >> |
|||||||||||||||||||||||