I want to backup sqlserver database using c# code.
For that i am using "BACKUP DATABASE" query.
So, suppose my "SQL server" is installed on same pc and i am trying to
running this query then this query is working perfectly.
But
suppose "SQL server" is installed on network environment means some on another system
I want to take "SQL server" database to my local system drive.
for example,
sql sever is installed on "TEST_SERVER"
and
another pc (say admin-pc) which is connected to same network
trying to take sqlserver database to local drive of "admin-pc"
what i am facing issue is that when i am trying to run code from local pc,
it is unable to access local system drive.
Getting error like this
Error
Means
it is able to connect sql server database.
it is able to take backup on system on which sql server is installed.
is is not able to take backup on local system drive
What I have tried:
BACKUP DATABASE test TO DISK = D:\1.bak