469,088 Members | 1,286 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,088 developers. It's quick & easy.

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 1171
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
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.