I have the following stored procedure I'm running but it only outputs on records. When I manually execute " exec Ntier_DesertOrtho.dbo.CreateAppointmentFile " I get all the records I'm expecting to get 100+ , but when I manually execute the entire below I get an output of 0 reported but the file is actually created with 1 record in it.
THank you for your help ....
DECLARE @sql varchar(8000)
SELECT @sql = 'bcp "exec Ntier_DesertOrtho.dbo.CreateAppointmentFile" '
+ 'queryout e:\bmc\extract\DOAppointments.csv -c -t^| -T -S'
EXEC master..xp_cmdshell @sql