When I execute this procedure without a trigger, it all works fine
EXEC sys.XP_CMDSHELL 'bcp "select * from users FOR JSON AUTO;" queryout E:\temp\JsonExport.json -t, -c -S . -d learntrigger -T'
but if I have created the trigger and make an INSERT
, then I get no response from the server and I have to end the command manually
CREATE TRIGGER usersJosnExportTrigger
ON users
AFTER INSERT, UPDATE, DELETE
AS
EXEC sys.XP_CMDSHELL 'bcp "select * from users FOR JSON AUTO;" queryout E:\temp\JsonExport.json -t, -c -S . -d learntrigger -T'
GO
This is the INSERT
I use
INSERT INTO users (username, email, number) values ('maxmuster','muster@gmail.com','123456789'),
I don't understand why and I hope you can help me.