Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy image file to OS folder through Triggers???

Status
Not open for further replies.

lingyi

Programmer
Apr 11, 2001
65
SG
hi,
Anyone got idea on how to write a stored procedure or triggers so that when data transfer reached sql, it will direct the sql to store the image file to specified folder in server instead on keeping it inside the sql database. THanks for helping..:)
 
Hi there,
Try using this
-----------------------------
Your procedure code .......
--This is the point where you want to copy the image file to a specified direcoty on server.
EXEC master..xp_cmdshell "copy myCurrentPath\myFile myNewPath\myFile", NO_OUTPUT

Your procedure code .......
-----------------------------
 
Hi rajeevnandanmishra,
Thanks for ur code, but I got several things that is not clear,
master..xp_cmdshell - is it a command that used in sql ? is this command always be the same ?

myCurrentPath\myFile - i going to transfer my image file to one of the database in sql server, then what is my current path for it??? This refer to when i haven't stored my image file to database ?

NO_OUTPUT - this command refer to what?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top