I am trying to save the xml string parameter received as a parameter to stored procedure in SQL server management studio 2012 in a file
When I try
DECLARE @cmd sysname, @var sysname;
SET @var = 'dir/p';
SET @cmd = @var + ' > dir_out.txt';
EXEC master..xp_cmdshell @cmd;
I get output having error as:
Access is denied
where is it trying to create a file?
I am running my code on test box connected to the server in ssms
please let me know what I should check if I am not having access to create and write to a file
dir/p
/p Pauses after each screenful of information.
- why are you doing what you posted?
- how are you un-pausing the /p
- where is the xml you talk about
- where is the stored procedure you talk about