Run command shell from trigger

Hi, I need to create a trigger that would run a shell command. How can this be done, if possible? I'd need the statement or where to get some detailed documentation. Is this common for all databases? ie Sybase, Oracle, MySQL, SQL... and so on... meaning, is it SQL standard or it depends on the database / Operating system.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan FranekCommented:
It surely depends on database system. In Sybase and MS SQL you can use xp_cmdshell extended stored procedure to execute any shell command from sql, so you can use it in trigger as well. I don't know, if it's possible in other database systems.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nickoargAuthor Commented:
are there limitations on the commands you can execute? obviously depending on the platform, but anything else? do the databeses always support xp_cmdshell by default? or is it an added "library" or so...
Jan FranekCommented:
Well, speaking of Sybase and MS SQL implementation:

In fact, extended stored procedures are executed by XP server not database server. But XP server is part of usual instalation and it is installed by default, so you don't need anything special to use it.

It runs on all platform that database runs on (MS SQL only on Windows, Sybase ASE on Windows, Linux, Solaris, AIX, HP-UX...).

There are some security related limitations - on Sybase (and probably on MS SQL as well) you can choose, what user context will the shell run in - it can be context of logged in user (there must exist OS user with the same login name) or context of user, that run database server.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.