需要在SQL表上触发,在表中插入时触发PHP脚本

I want to know if we can create a trigger in MS SQL server which triggers a php script on each insertion of record

Not sure why you want it, but try something in the line of:

DELIMITER @@

CREATE TRIGGER SomeTrigger 
AFTER INSERT ON SomeTable 
FOR EACH ROW 
BEGIN
   DECLARE cmd CHAR(255);
   DECLARE result int(10);
   SET cmd=CONCAT('sudo /path/to/php -f file.php');
   SET result = sys_exec(cmd);
END;
@@
DELIMITER ;
  1. I feel it break multilevel architecture and bad idea

  2. If it local php script, must be possible use exec

  3. If You don't need synchronous execution, You can in trigger add info to special table, and periodically check it from outside of SQL server. More this don't break architecture.

  4. If it remote PHP, good solution pointed in Can you call a webservice from TSQL code?