Joel Brown
asked on
T-SQL to CSV file
I have the following stored procedure I'm running but it only outputs on records. When I manually execute " exec Ntier_DesertOrtho.dbo.Crea teAppointm entFile " 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.Crea teAppointm entFile" '
+ 'queryout e:\bmc\extract\DOAppointme nts.csv -c -t^| -T -S'
+ @@servername
EXEC master..xp_cmdshell @sql
THank you for your help ....
DECLARE @sql varchar(8000)
SELECT @sql = 'bcp "exec Ntier_DesertOrtho.dbo.Crea
+ 'queryout e:\bmc\extract\DOAppointme
+ @@servername
EXEC master..xp_cmdshell @sql
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks everyone for your help ...