Link to home
Start Free TrialLog in
Avatar of nickoarg
nickoarg

asked on

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.
Thanks
ASKER CERTIFIED SOLUTION
Avatar of Jan Franek
Jan Franek
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nickoarg
nickoarg

ASKER

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...
Thanks
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.