xp_cmdshell

  • HI ALL

    We have sql server installed at some distant location and we use query analyzer to connect to this server. Now I want to take backup of the data from sql server to client machine. But first I want to check available space on client machine (where query analyzer is running).

     

    I am trying xp_cmdshell to run some DOS commands for getting the available space on client hard disk. But xp_cmdshell gives me the available space of the server where SQL Sever is installed.  

     

    Is there any other procedure / method to run DOS commands on the client side.

     

    Thanks in advance,

                                 

  • You cannot do this. All the SQL Server statements run on the server. The backup file will be written on the server, unless you specify a path to a shared folder on the client. It is very weird to make such a requirement (that the client has a writable share), but if you will go on this route, you can use master..xp_cmdshell 'dir \\clientcomputername\sharename' to find out the free space on the shared disk on the client computer.

    Razvan

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply