You can run an external program with the stored procedure xp_cmdshell and
you could build up a command line to pass to it within the trigger.
Be a little careful with xp_cmdshell - it can be a security hole. Unless
you set it explicitly to use Use SQLExecutiveCmdExec Account for non SA's
(you can do this in Enterprise manager, but I'm not sure how you do this
programmatically), the user executing xp_cmdshell will have the security
permissions assigned to the server and could, potentially, have
administrator rights on your server. Have a look at the documentation for
I don't think there are any procedures to write to or read from a serial
port, but you could create your own extended stored procedure (in VC++)
which you can then call from your triggers, sp's etc.
I have never tried to write and extended sp before, but that's the only way
I can think of to do what you want.