471,873 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

SQL Server invoking batch file

Hi,
I'm trying to write a trigger that on the insert/update of a column, I
want a directory to be created. If insert then create or if update
rename existing dir. Has anyone done thins before? Any pointers would
be appreciated.

Thanks.
Jul 20 '05 #1
1 1195
Swami (ch********@gmail.com) writes:
I'm trying to write a trigger that on the insert/update of a column, I
want a directory to be created. If insert then create or if update
rename existing dir. Has anyone done thins before? Any pointers would
be appreciated.


You could call xp_cmdshell to do the task. But this may have some
obstacles, if plain users are running it. And if many rows are
inserted/updated at the same time, you will have to loop over the
inserted table and call xp_cmdshell for each row. That is not good
for performance.

But this is a kind of odd thing to do. Maybe you could explain what your
business problem is for alternative solutions.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Petr PALAS | last post: by
1 post views Thread by Reza Sadeghi | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.