question

Murali avatar image
Murali asked

not generating xml file using bcp command

DECLARE @CMD VARCHAR(8000) select @cmd = ' bcp "select(select EMPLOYEE_ID,EMPCODE from .dbo. row for xml auto,root(''xml''), elements"),(select employee_id,empcode from .dbo. row for xml auto,root(''xml''), elements"))' + ' queryout "D:\BACKUP\employeesnew.xml" -S -U -P -w -r -t'; print @cmd EXEC XP_CMDSHELL @CMD;
t-sql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
WilliamD avatar image
WilliamD answered
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Murali avatar image Murali commented ·
i tried to different location also ...but it is not working
0 Likes 0 ·
WilliamD avatar image WilliamD commented ·
Have you tried running the command that is printed with PRINT @CMD in a command line to see if bcp runs?
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.