if exists(select 1 from sys.tables where name = 'bamboo')
drop table bamboo;
create table bamboo(leaf varchar(50));
go
create trigger test on bamboo
for insert
as
declare @sql varchar(8000)
SELECT @sql = 'bcp "select * from inserted" queryout c:/test.txt -c -t -T -S localhost\SQLEXPRESS'
exec xp_cmdshell @sql
go
insert into bamboo
select 'Kaching'
create trigger test on bamboo
for insert
as
declare @sql varchar(8000)
Select * into #inserted from inserted
SELECT @sql = 'bcp "select * from #inserted" queryout c:/test.txt -c -t -T -S localhost\SQLEXPRESS'